摘要:-----------------A. Helpful Maths----将一个由+和123组成的式子从小到大排序...----#include #include #include #include using namespace std;const int maxn=1111;char s[maxn];vectorvc;int main(){ vc.clear(); cin>>s; int len=strlen(s); for (int i=0;i='1'&&s[i]#include #include #include using namespac
阅读全文
摘要:Design the cityTime Limit:1 Second Memory Limit:32768 KBCerror is the mayor of city HangZhou. As you may know, the traffic system of this city is so terrible, that there are traffic jams everywhere. Now, Cerror finds out that the main reason of them is the poor design of the roads distribution, and
阅读全文
摘要:DescriptionDr.Ellie Arroway has established contact with an extraterrestrial civilization. However, all efforts to decode their messages have failed so far because, as luck would have it, they have stumbled upon a race of stuttering aliens! Her team has found out that, in every long enough message,
阅读全文
摘要:DescriptionProblem JJewel MagicI am a magician. I have a string of emeralds and pearls. I may insert new jewels in the string, or remove old ones. I may even reverse a consecutive part of the string. At anytime, if you point to two jewels and ask me, what is the length of the longest common prefix (
阅读全文
摘要:DescriptionPermutation TransformerWrite a program to transform the permutation1, 2, 3,...,naccording tominstructions. Each instruction(a,b)means to take out the subsequence from thea-th to theb-th element, reverse it, then append it to the end.InputThere is only one case for this problem. The first
阅读全文
摘要:*.bat@echo off :loop rand.exe > data.in std.exe std.out my.exe my.out fc my.out std.out if not errorlevel 1 goto loop pause goto loop
阅读全文
摘要:Graph and QueriesTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1333Accepted Submission(s): 267Problem DescriptionYou are given an undirected graph with N vertexes and M edges. Every vertex in this graph has an integer value assigned to it at the
阅读全文
摘要:改良#include #include #include #define MAX 100using namespace std;const int MAX_NODE=100;struct Node{ Node* ch[2];//左右子树 int fix;//优先级。数值越大,优先级越高 int key; int size;//以它为根的子树的总结点数 bool operatorsize; if (ch[1]!=NULL) size+=ch[1]->size; }};struct Treap{ Node nodePool[MAX_NODE]...
阅读全文
摘要:DescriptionProblem DMorley’s TheoremInput:Standard InputOutput:Standard OutputMorley’s theorem states that that the lines trisecting the angles of an arbitrary plane triangle meet at the vertices of an equilateral triangle. For example in the figure below the tri-sectors of angles A, B and C has int
阅读全文
摘要:Optimal MilkingTime Limit:2000MSMemory Limit:30000KTotal Submissions:10010Accepted:3630Case Time Limit:1000MSDescriptionFJ has moved his K (1 15, a row is broken into successive lines of 15 numbers and a potentially shorter line to finish up a row. Each new row begins on its own line.OutputA single.
阅读全文
摘要:Power NetworkTime Limit:2000MSMemory Limit:32768KTotal Submissions:20743Accepted:10866DescriptionA power network consists of nodes (power stations, consumers and dispatchers) connected by power transport lines. A node u may be supplied with an amount s(u) >= 0 of power, may produce an amount 0 #i
阅读全文
摘要:Priest John's Busiest DayTime Limit:2000MSMemory Limit:65536KTotal Submissions:7055Accepted:2405Special JudgeDescriptionJohn is the only priest in his town. September 1st is the John's busiest day in a year because there is an old legend in the town that the couple who get married on that da
阅读全文
摘要:Katu PuzzleTime Limit:1000MSMemory Limit:65536KTotal Submissions:6702Accepted:2463DescriptionKatu Puzzle is presented as a directed graphG(V,E) with each edgee(a,b) labeled by a boolean operatorop(one of AND, OR, XOR) and an integerc(0 ≤c≤ 1). One Katu is solvable if one can find each vertexVia valu
阅读全文
摘要:WeddingTime Limit:1000MSMemory Limit:65536KTotal Submissions:6919Accepted:2127Special JudgeDescriptionUp to thirty couples will attend a wedding feast, at which they will be seated on either side of a long table. The bride and groom sit at one end, opposite each other, and the bride wears an elabora
阅读全文
摘要:Ikki's Story IV - Panda's TrickTime Limit:1000MSMemory Limit:131072KTotal Submissions:6914Accepted:2565Descriptionliympanda, one of Ikki’s friend, likes playing games with Ikki. Today after minesweeping with Ikki and winning so many times, he is tired of such easy games and wants to play ano
阅读全文
摘要:Get Luffy OutTime Limit:2000MSMemory Limit:65536KTotal Submissions:6742Accepted:2583DescriptionRatish is a young man who always dreams of being a hero. One day his friend Luffy was caught by Pirate Arlong. Ratish set off at once to Arlong's island. When he got there, he found the secret place wh
阅读全文
摘要:Going from u to v or from v to u?Time Limit:2000MSMemory Limit:65536KTotal Submissions:12695Accepted:3274DescriptionIn order to make their sons brave, Jiajia and Wind take them to a big cave. The cave has n rooms, and one-way corridors connecting some rooms. Each time, Wind choose two rooms x and y,
阅读全文
摘要:Frogs' NeighborhoodTime Limit:5000MSMemory Limit:10000KTotal Submissions:6048Accepted:2621Special JudgeDescription未名湖附近共有N个大小湖泊L1,L2, ...,Ln(其中包括未名湖),每个湖泊Li里住着一只青蛙Fi(1 ≤i≤N)。如果湖泊Li和Lj之间有水路相连,则青蛙Fi和Fj互称为邻居。现在已知每只青蛙的邻居数目x1,x2, ...,xn,请你给出每两个湖泊之间的相连关系。Input第一行是测试数据的组数T(0 ≤T≤ 20)。每组数据包括两行,第一行是整数N(2
阅读全文
摘要:Full Tank?Time Limit:1000MSMemory Limit:65536KTotal Submissions:5754Accepted:1891DescriptionAfter going through the receipts from your car trip through Europe this summer, you realised that the gas prices varied between the cities you visited. Maybe you could have saved some money if you were a bit
阅读全文
摘要:Sightseeing CowsTime Limit:1000MSMemory Limit:65536KTotal Submissions:6908Accepted:2291DescriptionFarmer John has decided to reward his cows for their hard work by taking them on a tour of the big city! The cows must decide how best to spend their free time.Fortunately, they have a detailed city map
阅读全文
摘要:Cow RelaysTime Limit:1000MSMemory Limit:65536KTotal Submissions:4590Accepted:1823DescriptionFor their physical fitness program,N(2 ≤N≤ 1,000,000) cows have decided to run a relay race using theT(2 ≤T≤ 100) cow trails throughout the pasture.Each trail connects two different intersections (1 ≤I1i≤ 1,0
阅读全文
摘要:SightseeingTime Limit:2000MSMemory Limit:65536KTotal Submissions:6415Accepted:2265DescriptionTour operator Your Personal Holiday organises guided bus trips across the Benelux. Every day the bus moves from one citySto another cityF. On this way, the tourists in the bus can see the sights alongside th
阅读全文
摘要:【序】二分用的一点不熟,做个专题好了。---------------------一、从有序数组中查找某个值---------------------二、假定一个解并判断是否可行1、POJ1064有N条绳子长度为Li。从中切割出K条长度相同的绳子,求这K条绳子最长能有多长。const int maxn=11111;int n,k;double a[maxn];bool C(double x){ int sum=0; REP(i,n) sum+=int(a[i]/x); return sum>=k;}int main(){ while (~scanf("%d%d",&am
阅读全文