csu utilities

Learn about csu utilities, we have the largest and most updated csu utilities information on alibabacloud.com

CSU 1724 equal distance and (offline + segment tree)

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

"Mathematics" CSU 1810 Reverse (2016 Hunan province 12th session of computer Program design Competition)

- #defineMAX 0x7f7f7f7f to #definePI 3.14159265358979323 + #defineN 100004 - using namespacestd; thetypedefLong LongLL; * intCas,cass; $ intN,m,lll,ans;Panax Notoginseng LL Aans; - LL E[n],sum[n],l[n],r[n]; the LL A; + CharS[n]; A intMain () the { + #ifndef Online_judge - //freopen ("1.txt", "R", stdin); $ //freopen ("2.txt", "w", stdout); $ #endif - inti,j,k; - LL x, y; the //for (scanf ("%d", cass); cass;cass--) - //for (scanf ("%d", cas), cass=1;cassWuyi //while (~scanf ("%s", s)) th

"Analog" "math" CSU 1803 2016 (2016 Hunan province 12th session of university students computer Program design Competition)

voidWorkintXintc[]) + { A inti; thec[0]=x/ .; + for(i=1; i .); i++) c[i]=c[0]+1; - for(I= (x .)+1;i .; i++) c[i]=c[0]; $ } $ intMain () - { - #ifndef Online_judge the //freopen ("1.txt", "R", stdin); - //freopen ("2.txt", "w", stdout);Wuyi #endif the inti,j,k; - Wu //for (scanf ("%d", cass); cass;cass--) - //for (scanf ("%d", cas), cass=1;cass About //while (~scanf ("%s", s+1)) $ while(~SCANF ("%d",N)) - { -scanf"%d",m); -aans=0; A Work (n,a); + Work (m,b); t

CSU 1505 Cool word Hunan Province Race tenth session topic

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;

CSU 1511 mutilated chessboard tenth session of Hunan Province game problem

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

CSU 1515 Sequence

MO Team Algorithm +map#include #include#include#include#includeusing namespacestd;Const intmaxn=200000+Ten;intn,t,a[maxn],cnt[maxn*Ten],POS[MAXN];structx{intL,r,id;} S[MAXN];intL,r;intANS,F[MAXN];BOOLcmpConstXa,Constxb) { if(POS[A.L]==POS[B.L])returna.rB.R; returnpos[a.l]POS[B.L];}intMain () { while(~SCANF ("%d",N)) {scanf ("%d",t); intsz=sqrt (n); for(intI=1; i) {scanf ("%d",A[i]); Pos[i]=i/sz; } for(intI=1; i) {scanf ("%d%d",s[i].l,S[I].R); S[i].id=i; } sort (S+1, s+1+t,cmp); Mapin

CSU 1110 Segment Tree

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)

CSU 1529 Equator DP

Queue Optimization DPEquator Time Limit: 5000MS Memory Limit: 131072KB 64bit IO Format: %lld %llu Submit StatusDescriptionInputOutputSample Input33 1 2 38 4 5-1-1 1-1-1 52-1-1Sample Output6140/* ***********************************************author:ckbosscreated time:2015 March 17 Tuesday 20:13 17 seconds file Name : csu1529.cpp************************************************ * * #include CSU 1529 Equat

CSU 1535:pizza Voting (thinking)

http://acm.csu.edu.cn/OnlineJudge/showsource.php?id=97625#include   CSU 1535:pizza Voting (thinking)

CSU 1581Clock Pictures Hash

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

CSU 1574 Amanda Lounges Simulation problem

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

CSU 1550:simple String (String)

, 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]

CSU 1584 Train passengers

#include   CSU 1584 Train passengers

CSU 1659:graph Center (SPFA)

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

CSU 1617:itself is itself (strong connected pinch point) thought switch to graph theory

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

CSU 1554SG Value Dynamic Maintenance minimum non-constituent number

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

CSU-1115 Shortest name (Dictionary tree template problem)

. 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

CSU 1577:dice Game

#include CSU 1577:dice Game

CSU 1563:lexicography (mathematical counting problem)

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

Rectangle (CSU)

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

Total Pages: 15 1 .... 4 5 6 7 8 .... 15 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.