should be from which to start adding, LRT some numbers, and then take the i,i+l ... , look at the last few not taken, and then l this value is RRT inside the beginning, how to ask for this beginning, to record how many values in the LRT node NUM[LRT], and then assume that from the I-Bit and, ((num[lrt]-(i+1))%l+l)%l, This is a description of the last few LRT node is not selected, and then L ((num[lrt]-(i+1)%l+l)%l-1 is in the RRT inside the opening position (position from 0 to L-1), so OK AH;Ma
Title Link: http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1505Test instructions: The trick is that the number of occurrences of each letter in a line of characters is different, and the word is cool.Problem-solving ideas: Look at the test instructions, combined with the case, you can understand that only need to count the number of characters in the string in the line.AC Code:#include #include#include#includeusing namespacestd;Const intm= -+5;intN,ans,a[m],b[m];CharS[m];intMain () {intN,ca=1;
Title Link:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1511The main topic: In a 8*8 board, give you a starting position and an end location, but also give you a trap location, ask you from the beginning to bypass the trap to the end of the shortest distance. (You can walk up and down or you can walk diagonally)Problem-solving ideas: can be directly with the search, can also use mathematical knowledge to solve, we have learned before, two points directly between the shortest, so when the tra
C-RMQ with ShiftsTime limit:MS Memory Limit:131072KB 64bit IO Format:%lld %llu SubmitStatusPracticeCSU 1110Appoint Description:System Crawler (2015-03-10)DescriptionIn the traditional RMQ (Range Minimum Query) problem, we have a static array A. Then for each query (L, R) (lInputThere be is only one test case, beginning with the integers n, q (1OutputFor each query, print the minimum value (rather than index) in the requested range.Sample Input7 2 4 8 5 1 4query (3,7) Shift (2,4,5,7) query (1,4)
Topic Link: Click to open the linkTest instructionsgives the X-pointer of the alarm at the current point of viewAsk if 2 alarms can be the same after rotationIdeas:First order to ensure the relationship between the partial order, and then sit poor,Enumerates which one of the second string matches the first character of the first string, and then the hash determines#include CSU 1581Clock Pictures Hash
Topic Link: Click to open the linkTest instructionsA graph of the n-point m edges (starting at each point is white)The following M-line gives the edges and edges, and the edge weights indicate the number of dots that are dyed black in the 2 points connected by the edge.0 means dye, 1 means one dianran, and 2 means dye.Q: The minimum number of points to be dyed can meet the above edge rights. If there is no output impossibleThe case of all edge weights 0 and 2 is processed first.In this case, onl
, we can list 9 scenarios: Judging if a string in C is compliant with test instructions.Because one of the letters in A, B is up to N to form C, (when a string of a B is greater than n, it can only be taken out of N) in order to satisfy the conditions that make up the C string.
A[i]
A[i]=n
A[i]>n
B[i]
C[i]
C[i]
C[i]
B[i]=n
C[i]
C[i]
C[i]
B[i]>n
C[i]
C[i]
C[i]
1659:graph Center Time
limit: 1 Sec
Memory Limit: MB
Submit:
Solved: 25
[Submit] [Status] [Web Board]
DescriptionThe center of a graph is the set of any vertices of minimum eccentricity, that's, the set of all vertices a where the GRE Atest distance D (A, b) to and vertices B is minimal. Equivalently, it is the set of vertices with eccentricity equal to the graph ' s radius. Thus vertices in the center [central points] minimize the maximal distance from other points i
1617:itself is itself time
limit: 6 Sec
Memory Limit: MB
Submit:
Solved: 4
[Submit] [Status] [Web Board]
DescriptionZuosige always have bad luck. Recently, he is in hospital because of pneumonia. While he was taking his injection, he feels extremely bored. However, clever zuosige comes up with a new game.Zuosige writes an integer n and a polynomial function:P (x) = (A0+a1*x+a2*x2+...+am*xm) mod N.He wants to know how many subsets of set {0, 1, 2, ..., n-2, n-1} satisf
Topic Link: Click to open the linkTest instructionsN Operations1 Val Insert Val in the collection2 querying the current collection sum of the minimum positive integers that cannot be obtained by any numberIdeas:Empty collection when Ans=1And after inserting the number ans can only increase, so maintain this ansAns is a1+a2+a3. +ai So ans is the smallest prefix and +1 and Record ai+1 with Multiset AnThe answer is only updated when the number of ----------------Prove:First we set this smallest not
. theTree p=h; - intlen=strlen (s);Wuyi for(intI=0; i) the { - intindex=s[i]-'a'; Wu if(p->next[index]!=NULL) - { AboutP=p->Next[index]; $p->count++; - } - Else - { ATree tem= (tree)calloc(1,sizeof(node)); +Tem->count=1; thep->next[index]=tem; -p=tem; $ } the } the } the the intFind (Tree h) -{//Find a node that is not empty, plus the corresponding number of times, if the count value is greater than 1, then there is a bra
1563:lexicography time
limit: 1 Sec
Memory Limit: MB
Submit: 342
Solved: 111
[Submit] [Status] [Web Board]
DescriptionAn anagram of a string was any string that can be formed using the same letters as the original. (We consider the original string an anagram of itself as well.) For example, the string ACM have the following 6 anagrams, as given in alphabetical order:AcmAmcCAMCmaMacMcaAs another example, the string ICPC has the and the following anagrams (in alphabetica
DescriptionNow, there is some rectangles. The area of these rectangles are 1* x or 2 * x, and now your need find a big enough rectangle (2 * m) so this you can put AL l rectangles into it (these rectangles can ' t rotate). Please calculate the minimum m satisfy the condition.InputThere is some tests, the first line give the test number.Each test would give you a number n (1OutputEach test would output the minimum number m to fill all these rectangles.Sample Input231 22 22 331 21 21 3Sample Outpu
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.