HDU 1518-Square

This allows the given wooden sticks to splice out squares, search for backtracing, and pay attention to pruning. CodeAs follows: # Include # include # include # include # include using namespace STD; int num, lenth; int A [21], CCT; bool

10098-generating fast

Description: it is a simple question. Just write it in the method in Liu lujia's book, and then you can access Code I. # include # include # include # include using namespace STD; void print_permutation (char * P, char * q, int Len, int cur)

10026-Shoemaker's Problem

Description: it is the cost-effectiveness problem. Whoever has a high cost-performance ratio takes priority. if the same is true, in the order of work, the priority is # include # include # include int CMP (const void * P1, const void * P2) {If

755-487-3279

# Include # include # include # include # define n 100100 using namespace STD; int fcmp (const void * P1, const void * P2) {return strcmp (char *) P1, (char *) P2);} int main () {// freopen ("a.txt", "r ", stdin); int N, I, j, M, Len, flag; char

Ultraviolet A 10763-Foreign Exchange

The two series are sorted and compared. If they are identical, "yes" is output; otherwise, "no" is output ". CodeAs follows: # Include # include # include # include # include # include using namespace STD; int n_cmp (const void * a,

Ultraviolet A 188-perfect hash

The simulation can be done according to the question. The only thing worth noting is that there may be more than one space between two words, because this Re has been performed several times. CodeAs follows: # Include # include # include #

Ultraviolet A 10400-Game Show Math

DFS + pruning. Because the range of each operation in the question must not exceed-32000 ~ 32000. Therefore, the state of each operation can be stored in a vis array. As long as the number of operations is repeated, it is unnecessary to perform

UV 167-The Sultan's Successors

In the classic "Eight queens problem", traverse all the situations and calculate the maximum value. The Code is as follows: # Include # include # include # include # include using namespace std; int a [9] [9], vis [3] [20], save [9], n, tot;

Zoj 1354 extended lights out

Extended lights out Time Limit: 2 seconds memory limit: 65536 KB In an extended version of the game lights out, is a puzzle with 5 rows of 6 buttons each (the actual puzzle has 5 rows of 5 buttons each ). each button has a light. when a

Ultraviolet A 140-Bandwidth

In full arrangement, the maximum value of "Bandwidth" in each arrangement is recorded, and the smallest value among all the maximum values is output. The Code is as follows: #include #include #include #include #include #include using namespace

Ultraviolet A 539-The Settlers of Catan

Search backtracing. In fact, it was a relatively simple question, but it was a bit slow because I was reading the wrong question and had trouble at the beginning, so I looked at the code written by others and found that I had trouble checking my

Ultraviolet A 165-Stamps

It is difficult to understand the general idea of this question. Given h (number of stamps), k (number of stamps allowed) (h + k Example: h = 3 k = 2. If the two nominal values are, the maximum continuous values of 1, 2, 3, 4, 5, 6, 7, and 9 can be

Ultraviolet A 10125-sumsets

Method 1: brute-force enumeration is supported. In fact, it is an accident to use the enumeration method. (You can try 1000 pieces of 1 data, which cannot be run .) Method 2: Convert the problem to a + B = d-c. In this way, you only need to

Ultraviolet A 10033-Interpreter

The key to simulating a question is that the question is not easy to understand, especially the two commands. 8da: copy the value of the memory unit whose address is "register a value" to register d. 9sa: Copies the value of register s to the memory

Ultraviolet A 101-the blocks Problem

It is not difficult to simulate the stack. You can handle the simultaneous situations of Block a and block B, but I still don't understand why the RE was so many times, if the array cn is small, it will be RE, but according to the topic, it is

Hdu2821 pusher hdu3500 fling DFS search

 Pusher Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/65536 K (Java/Others)Total Submission (s): 169 Accepted Submission (s): 67Special JudgeProblem DescriptionPusherBoy is an online game http://www.hacker.org/push. There is an R * C

HDU 4115 Eliminate the Conflict 2-sat

# Include # include # include # include # include # include # include # include using namespace std; const int MAXE = 10000002; const int MAX = 20009; int vis [10009]; struct Point {int x, y;} p [10009]; struct EDGE {int v; // The vertex v

Ultraviolet A 10603-Fill

The problem of pouring water, bfs + hash, needs to save all the pouring water of each step, and finally sort it in another order, output the largest d with less than or equal to d and the matched total water volume. The Code is as follows: #

116-unidirectional TSP

Description: The minimum value is actually found from this array. The state equation is: s [I] [j] + = min (s [a] [j + 1], s [B] [j + 1]), s [c] [j + 1]); but it is rare that this is not the case. Instead, it is necessary to find a path that

Ultraviolet A 321-the new villa

I originally wanted to use BFS (room status) + DFS (lamp status) + hash, but at last I found that the same room can be repeated several times to enable the switch of some lights, in this way, each step will have a high price for DFS. Referring to

Total Pages: 64722 1 .... 56420 56421 56422 56423 56424 .... 64722 Go to: GO

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.