Lattice fetch number problem

Source: Internet
Author: User

Title Details: There are n*n, each lattice has a positive number or 0, from the top left corner to the bottom right corner, can only
Down and to the right, a total of two times (that is, from the upper left to the lower right corner to walk two times), the number of all the past lattice added up,
The maximum sum is calculated and two times if the same lattice is passed, the count of the lattice in the last sum sum is only added once. method One:

Refer to Chapter 34 of the Art of programming
Time complexity is O (n^3)
http://blog.csdn.net/rowanhaoa/article/details/15816067
It's called a two-thread dynamic programming problem , and it feels like a good idea. Method Two:

Http://www.360doc.com/content/13/1127/17/14357424_332618655.shtml
This method of time complexity is O (n^4), although slightly worse, but easy to understand

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.