corresponding to the count (i,j) *BJ and then by AI, accumulation is the answer, note here to be similar to the topological sort, but to do backwards, to avoid the aftereffect of Reference blog HTTP/ blog.csdn.net/qq_21057881/article/details/52431139#include #includestring.h>#include#include#include#includeusing namespacestd;#defineLL Long LongConst intMAXN = 1e5+7;Const intMoD = 1e9+7; Vectorint>E[MAXN];intA[MAXN],B[MAXN],D[MAXN];intANS[MAXN];intMain () {intn,m; while(Cin >> N >>m) {
Links:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1612Test instructions: Give a matrix a size n*n, B = a^1 + a^2 + a^3 + .... A^n, there are no 0 items in B.The title can be converted to n points numbered 1-n, for any point V, after some arbitrary step to reach U (U for any point set of any one). In discrete mathematics, the matrix-related knowledge a^k of graphs represents the number of steps in the matrix from I to J in step K.The question is whether the graph is strong or not.Learn the K
1323:zzy and his little friendsTime Limit:5 Sec Memory limit:256 MB
submit:239 solved:103
[Submit] [Status] [Web Board]
Description
Zzy raised a little monster and N Bump man, singled out every bump is not the opponent of the small monster, so must be two bump-man cooperation to fight with the small monsters. The combat effectiveness of bump man A and bump man B is the difference or value of their combat effectiveness. Now it is up to the zzy to fight the little monsters by electing two from th
1855:shut the Box Submit Page Summary time limit:1 sec Memory Limit : 256 mb submitted:37 solved:9 Description
Shut the Box is a one-player game, begins with a set of n pieces labeled from 1 to N. All pieces are initially '
Tan Songsong's travel plans
Time limit:3000/1000ms (java/others) Memory limit:65535/65535kb (java/others)Submit Status
Tan Songsong is a person who loves to travel, he loves traveling very much, even if the body is emptied also must insist on
Topic link Pigs can ' t take a sudden turn
Time limit:1000 Ms Memory limit:65536 KB
problem Descrpition
You maybe has aced a question about computational Geometry,which describes the dogs ' journey and calculate the shortest D Istance between them.
1510:happy RobotTime limit:1 Sec Memory limit:128 MBsubmit:19 Solved:7DescriptionInputThere'll is at the most test cases. Each case contains a command sequence with no more than characters.OutputFor each test case, print the case number, followed by
DP is a simple question. It was previously written using a for loop. This time it is written using state recursion. I feel that the idea is clearer than before.
1 #include 2 #include 3 const int maxm=500+5,maxn=1000+5; 4 int
Question link: http://acm.csu.edu.cn/OnlineJudge/problem.php? Id = 1290
Question:
Given the number of K, you can generate any number in 0-n-1 each time. The mathematical expectation of the number of K numbers with different integers
1 # include 2
1459: ChessTime Limit: 1 Sec Memory Limit: 128 MB Special Judge
Submit: 58 Solved: 31
[Submit] [Status] [Web Board]
Description
Input
Output
Sample Input
3E 2 E 3F 1 E 8A 3 A 3Sample Output
Impossible2 F 1 B 5 E 80 A 3
Given the start point and
1601:war time
limit:1 Sec Memory limit:128 MBsubmit:127 solved:36[Submit] [Status] [Web Board]
DescriptionAME decided to destroy CH ' s country. In CH ' country, there is N villages, which is numbered from 1 to N. We say village A and B are
DescriptionInputThe input contains no more than 10000 sets of data. Each set of data contains 6 integers r1, C1, R2, C2, R3, C3 (1OutputFor each set of data, the test point number and the minimum number of steps are output.Sample Input1 1 8 7 5 (1 3
Description Input Output Sample Input 35 3 4 15 3 110 2 2 3 3100 1 100 1 2 Sample output 4350 Question: calculate the number of elements with the same equidifference Sequence Idea: first, we can assume that the solution is F1 + D1 * k1
/* The Shortest Path + the minimum spanning tree. A graph is given, starting point, and ending point. Find the path from the start point to the end point (the longest section of this path must be the shortest !) Enumerate the "Longest path", which
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.