[Euclidean & Extended Euclidean]

Euclidean Ll gcd (ll a, LL B) {return (B = 0 )? A: gcd (B, A % B );} Extended Euclidean Int ex_gcd (int A, int B, Int & X, Int & Y) {// returns the maximum approximate number if (B = 0) {x = 1; y = 0; return A;} int d = ex_gcd (B, A % B, x,

[Bipartite graph multi-match] poj 2289

Improved Hungary water over Ms .... # Include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include using namespace STD; # define ll

[Tree DP] poj 1463

DP [k] [0] indicates the minimum number of knots required for the subtree with K points as the root (K is not used). Similarly, DP [k] [1] indicates the minimum number of knots required for the subtree with K points as the root (k-Fetch). If the

[Maximum minimum fee stream] poj 2195

It can be km, or charge, and recently the tuition fee is used. So it is a waste of time to use DEBUG. I thought there was a problem with spfa. It turns out there was an error in counting... Sorry, the food, the saying is that poj 2516 still does not

DP: poj 1141

Http://poj.org/problem? Id = 1141 DP to find the optimal solution. # Define n 110 char STR [N]; int DP [N] [N]; // the minimum number of characters inserted between I and j. Int tag [N] [N]; // record the location where characters need to be

[Group backpack] HDU 3535

Int max (int A, int B) {return A> B? A: B;} int DP [110] [110]; int main () {int N, T; while (scanf ("% d", & N, & T )! =-1) {int I, j, k; memset (DP, 0, sizeof (DP); for (I = 1; I = W; j --) {DP [I] [J] = max (DP [I] [J], DP [I] [J-W] + V ); //

[Minimum cut] USTC 1280

Http://acm.ustc.edu.cn/ustcoj/problem.php? Id = 1280 This is the subject of the China University of Science and Technology's "age point technology Cup" ACM New Year's Eve challenge. At that time, I couldn't do it. Later I Thought About It. tle1, WA

[Minimum cost and maximum flow] poj 2516 [unsolved]

Fuck !!! Wa is dead. I don't know where it is... Put it first # Include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include using

[Number of different substrings In the suffix array] spoj694 spoj705

Spoj694 http://www.spoj.pl/problems/DISUBSTR/ Spoj705 http://www.spoj.pl/problems/SUBST1/ The two questions are similar, but only 705 of the data is a little bigger. There is no pressure to use the multiplier algorithm. Continue to set the template.

[Kmp template] poj 3461

KMP template question, not easy to understandMatrix67's blog complexity allocation is O (n) # Define n 1000010 char W [10005]; // short stringchar T [1000005]; // long stringint P [10005]; // array P [J], indicates the maximum number of int sum;

[Returns the consecutive repeated substrings with the largest number of duplicates in the suffix array] spoj687 poj1_3

Spoj 687 # Include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include using namespace STD; # define ll long # define PII pair #

[KMP] poj 2752

Understand the meaning of the P array in the KMP algorithm (commonly used next array, but I used to name it p ^_^). The meaning of the P array is the same as that of the maximum K characters in the prefix, therefore, finding J = P [J] from the last

[Minimum path coverage] poj 2060

The following describes how to use a few taxis to complete n tasks:Minimum path Overwrite= Points-Maximum number of matches, here there is a detail http://www.cnblogs.com/ka200812/archive/2011/07/31/2122641.html of attention #include #include

[KMP] poj 2406

How many repeated strings exist in a string? If the result of ababab is 3, A = AB. Method: The array P [I] is obtained through KMP preprocessing. It is easy to obtain that the length of a is len-P [Len]. #include #include #include #include #include

[KMP] poj 1961

This is similar to poj 2752. Because prefix is required, you need to traverse from the beginning to the end to find each prefix that meets the requirements. #include #include #include #include #include #include #include #include #include #include

[KMP: The longest public substring of multiple strings] poj 3450

Strange, this question is modified by poj3080 and AC, but it cannot be used in poj3080. It is strange to say that... Is the RP of Brother's low to this ?! #include #include #include #include #include #include #include #include #include #include

[Codeforces #91 div2]

Question A and question B. C: brute-force enumeration L ~ R between the lucky number, because there are a maximum of 1500 lucky number, so you can be bold and violent! Note int Overflow #include #include #include #include #include #include #include

[KMP calculates the longest public sub-fix before and after the two substrings] HDU 2594

Start Sb-based violence, that is, enumerating a string, and the result is Sb-based TLE... Later I found that I am really Sb, and I did not take advantage of the elegant nature of KMP at all. In the main program of KMP (the main program and the

[Minimum path overwrite + note] poj 2594

Pay attention to this question. The question says you should notice that the roads of two different robots may contain some same point. is to pay attention to this detail http://www.cnblogs.com/ka200812/archive/2011/07/31/2122641.html, to use a

[DP] HDU -- 4105

F [I] [J] [2] indicates that the number of the first I ends with the number of J, 0 indicates the trough, and 1 indicates the peak. Transfer equation: F [I] [J] [0] = max (F [I] [J] [0], f [I-j] [k] [1] + 1 ); F [I] [J] [1] = max (F [I] [J] [1], F

Total Pages: 64722 1 .... 56260 56261 56262 56263 56264 .... 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.