csu utilities

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

CSU 1266:divisible by 11 (math AH)

Title Link: http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1266Descriptionfor an integerx, rememberxThe right-to-left members are respectively the first1bit, section2bit, ... IfxThe sum of the numbers on the odd digits minus the sum of the numbers on the even digits can be Onedivisible, thenxyou can be Onedivisible. Input The first line of the input data contains an integer t (1 t one row for each set of test data, with a number of digits not exceeding - a positive integer of a bit

CSU 1268 1268:pingpang Balls (math AH)

data, the first row contains5an integerN (1 , meaning ibid. The next line containsNa no greater than -A positive integer, which in turn describes the weight of each table tennis. Outputfor each set of data, output three integers in one line, separated by spaces, indicating N a ball of Samsung, two stars and a star of the ball each have how many. Sample Input25 10 1 2 36 7 9 9 106 10 1 2 311 12 12 13 14 8Sample Output3 0 11) 3 1HINTSourceThe Seventh annual College student Program Design Competit

CSU 1407: Shortest distance (math AH)

Title Link: http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1407Descriptiontwo pointsA,Bare doing uniform motion. Give theT= 0 MomentsA,Bthe coordinates, andA,Bthe speed, calculationT≥0 O'Clock the minimum value of the distance between two points. Inputthe first line of input contains an integerT(1≤T≤ $), indicating that there are altogetherTGroup test Data. for each set of test data, the first row consists of 4 integersxA,yA,vAx,vAy( -103≤xA,yA,vAx,vAy≤Ten3), indicatingT= 0 MomentsAthe coordin

CSU 1335: Takahashi and Low Bridge (scan line) 13 Provincial game problem

the swollen level AI and water level bi for the flood of the first I, and count how many bridges have been flooded at least k times. The initial water level is 1, and the swollen water level of each flood must be greater than the water level of the last flood.InputThe input file contains up to 25 sets of test data. The first behavior of each group of data is three integers n, m, K (1OutputFor each set of data, output the number of bridges that have been flooded at least k times.Sample Input2 2

CSU 1769 (mathematics)

Owners" of 2 lives, and a "whirlwind effect" followed by 2 life-threatening "slave-owners" and 1 1-point life "terror slaves".In this series of topic 2 we have learned how to calculate how many "horrible slave owners" will be left after the N-whirlwind effect. Now that the game has a bug, the number of slave owners on the field is no longer limited by the 7 limit. There are some 1 lives left on the field, some 2 lives, some 3 life slaves, and now ask the slave owners to go through the N-whirlwi

CSU OJ 1811:tree intersection (heuristic merge)

) { theEdge[tot].next =Head[u]; *Edge[tot].to =v; $Edge[tot].index =ID;Panax NotoginsengHead[u] = tot++; - } the + voidDfsintUintPreintID) { ACnt[u][color[u]] =1; theAns[u] = Cnt[u][color[u]] 1:0; + for(inti = Head[u]; ~i; i =Edge[i].next) { - intv =edge[i].to; $ if(v = =pre) $ Continue; - Dfs (V, u, edge[i].index); - if(Cnt[u].size () cnt[v].size ()) { the swap (Cnt[u], cnt[v]); - swap (Ans[u], ans[v]);Wuyi } the for(Auto It:cnt[v]) { -

CSU 1120 virus (Classic template example: Maximum public increment subsequence)

output.Sample Input19 1 4 2 6 3 8 5 9 16 2 7 6 3 5 1Sample Output3 compared to the monotonically increasing, the longest common subsequence, this problem will combine the two, very classic example. 1#include 2#include 3#include string.h>4#include 5 using namespacestd;6 Const intmaxn=1005;7 intdp[maxn],a[maxn],b[maxn],n,m;8 intLICs ()9 {Ten intI,j,max; OneMemset (DP,0,sizeof(DP)); A for(i=1; i) - { -max=0; the for(j=1; j) - { - if(A[i]>b[j] maxDp[j]) -M

Math---CSU 1554:sg Value

--) {LL type; CIN>>type; if(type==1)//Insert{LL num; CIN>>num; if(num>v+1) {q.push (num); } Else{v+=num; while(!Q.empty ()) {LL tmp=Q.top (); if(tmp1) {v+=tmp; Q.pop (); } Else Break; } } } Elsecout1Endl; } } return 0; } /* */ /*******************************************

CSU 1548:design Road (three points)

Test instructions: Needs to be repaired from (0,0) point to (x, y)Where there are n and y axes parallel to the riverUnit cost of road repairing C1 repair Bridge Unit Cost C2Q What is the minimum total cost?Idea: Merge all the riversThe length of the bridge repeatedlyFind the minimum cost#include   CSU 1548:design Road (three points)

Water---CSU 1550:simple String

) {if(dd[i]>0) {sum+=Dd[i]; if(dd[i]>Bb[i]) {Flag=false; Break; } } } if(!flag) {Puts ("NO"); Continue; } inthalf=len/2; Sum=0; for(intI=0;i -;++i) {if(dd[i]0) {sum+=min (bb[i],cc[i]); } Else{sum+=min (bb[i],cc[i]); } } if(sum>=half) {Puts ("YES"); Continue; } Else{puts ("NO"); Continue; } } return 0;}/**//****************************************

Three-point---CSU 1548:design Road

) { DoubleL=low,h=High ; DoubleMid= (L+H)/2, mmid= (mid+h)/2; DoubleCmid=calc (mid), cmmid=Calc (mmid); while(Fabs (Cmmid-cmid) >=1e-Ten) { if(cmid>cmmid) L=mid; Elseh=Mmid; Mid= (l+h)/2, mmid= (mid+h)/2; Cmid=calc (mid), cmmid=Calc (mmid); } returnmin (cmmid,cmid);}intMain () {intN; while(cin>>n>>x>>y>>c1>>C2) {Sum=0.0; DoubleTMP1,TMP2; for(intI=1; ii) {cin>>tmp1>>TMP2; Sum+=TMP2; } xx=x-sum; printf ("%.2lf\n", Solve (0.0, y)); } return 0;}View Cod

CSU 1526 Beam Me out! Strong connectivity

Topic Link: Click to open the linkTest instructionsA direction graph for a given n points (1 is the starting point and N is the end point)Each of the following lines gives the degree of a point and the next point to which it is connected.The nth point is not out of the degreeThe picture is like this: 1->2, 1->3, 2->3First question:If there is a scheme that allows this person to enter a point and no longer reach the end of the output PRISON, otherwise the output pardonSecond question:If this pers

CSU 1552:friends graph theory match + super large prime number judgment

//Dfs Augmentation Road the {Bayi for(intI=1; i) the { the if(edge[x][i]!Vis[i]) - { -vis[i]=1; the if(lin[i]==-1|| DFS (Lin[i]))//I have no matching or matching can get the augmented path the { thelin[i]=x; the return true; - } the } the } the return false;94 } the the intMain () the {98 while(SCANF ("%d", n)! =EOF) About { -Memset (Edge,0,size

CSU 1395:timebomb (Analog)

Test instructions: Give some numbers if they can be divisible by 6 output beer!! Otherwise output boom!!Idea: Save 0 to 9 with a three-dimensional arrayViolence out of every number of valuesFind the results(This is a bit of a hole in the 1 number may not exist 2 number of uncertainties)#include   CSU 1395:timebomb (Analog)

CSU 1757 (greedy or tree-like array)

.#include #include#include#include#includeusing namespacestd;Const intN =100005;intX[n],a[n],b[n];intC[n],n;intLowbit (inti) { returni (-i);}voidUpdateintIdxintv) { for(inti=idx;i2*n;i+=lowbit (i)) {C[i]+=v; }}intGetsum (intidx) { intsum =0; for(inti=idx;i>=1; i-=lowbit (i)) {Sum+=C[i]; } returnsum;}intMain () {inttcase; scanf ("%d",tcase); while(tcase--) {memset (c,0,sizeof(c)); scanf ("%d",N); intCNT =1; for(intI=1; i) {scanf ("%d%d",a[i],B[i]); X[cnt++] =A[i]; X[cnt++] =B[i];

CSU 1515 Sequence (Mo team algorithm)

; I i) {if(A[i].val = = a[i-1].val) B[i] = b[i-1]; Else if(A[i].val = = a[i-1].val +1) B[i] = b[i-1]+1; ElseB[i] = b[i-1] +2; } for(inti =1; I i) {c[A[i].pos]=B[i];} memset (tmp,0,sizeoftmp); for(inti =0; I i) {scanf ("%d%d", q[i].l,Q[I].R); Q[i].id=i; } sort (q, q+m); intPL =1, PR =0; ll ans=0; for(inti =0; I i) {intID =q[i].id; intL =Q[I].L; intR =Q[I].R; if(PR for(inti = pr+1; I 1); Else for(inti = PR; i > R; -i) ans + = Update (C[i],-1); if(PL for(inti = pl; I 1); PR= r,

"Scan line or tree-like array" CSU 1335 Takahashi and Low bridge

); + } - returnRes; the } * voidInit () $ {Panax Notoginsengmemset (Tree,0,sizeof(tree)); - } the intMain () + { A intcas=0; the while(~SCANF ("%d%d%d",n,m,k)) + { - init (); $ for(intI=1; i) $ { -scanf"%d",a[i]); - } theSort (A +1, a+n+1); - intx, y;Wuyi intst=1, ed; the for(intI=1; i) - { Wuscanf"%d%d",x,y); -Ed=x; About intPos1=upper_bound (A +1, A +1+N,ST)-A; $ intPos2=upper_bound (A +1, A

World top System Optimization Tools tuneup Utilities 2011 Basic Tutorials

TuneUp Utilities, believe that friends familiar with the software should have heard, the software from Germany, is recognized in the world's best system tuning tool, known as "PC system maintenance Swiss Army knife." At present, TuneUp Utilities version 2011 has been released, this issue will lead us to try TuneUp Utilities 2011, to see the world's top system opt

CSU-1632 repeated substrings[suffix array to find the number of substrings that occur repeatedly]

Evaluation Address: https://cn.vjudge.net/problem/CSU-1632Descriptionin the string, all occurrences of at least 2 number of sub-strings of the secondInputfirst act an integer T (t represents the number of use case groups, with each group of use cases occupying a length of 100000 the stringOutputFor each set of use cases, output the number of substrings that appear at least two times in the stringSample Input3AabaabAaaaaAaAaASample Output545SolutionAns

CSU 1337 (flt theorem)

CSU 1337Time Limit:1000MSMemory Limit:131072KB64bit IO Format:%LLD %lluDescriptionFlt theorem: When n>2, the indefinite equation AN+BN=CN has no positive integer solution. For example, A3+B3=C3 does not have a positive integer solution. To enliven the atmosphere, we might as well have a funny version: Change the equation to a3+b3=c3, so there are solutions, such as a=4, B=9, c=79 43+93=793.Enter two integers x, y, to satisfy the xInputEnter up to 10 s

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