03 2013 档案
摘要:Color the ballTime Limit: 9000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4961Accepted Submission(s): 2624Problem DescriptionN个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a #include
#include
#define lson t=r)update(lson,l,r,rt[t].lazy+num); else if(rt[rson].l=id...
阅读全文
摘要:E -Sweets GameTime Limit:3000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 63EDescriptionKarlsson has visited Lillebror again. They found a box of chocolates and a big whipped cream cake at Lillebror's place. Karlsson immediately suggested to divide the s
阅读全文
摘要:C -Bulls and CowsTime Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 63CDescriptionThe "Bulls and Cows" game needs two people to play. The thinker thinks of a number and the guesser tries to guess it.The thinker thinks of a four-digit numbe
阅读全文
摘要:D -Dividing IslandTime Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 63DDescriptionA revolution took place on the Buka Island. New government replaced the old one. The new government includesnparties and each of them is entitled to some part of the
阅读全文
摘要:D -WormhouseTime Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 62DDescriptionArnie the Worm has finished eating an apple house yet again and decided to move. He made up his mind on the plan, the way the rooms are located and how they are joined by c
阅读全文
摘要:B -Tyndex.BromeTime Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 62BDescriptionTyndex is again well ahead of the rivals! The reaction to the release of Zoozle Chrome browser was the release of a new browser Tyndex.Brome!The popularity of the new br
阅读全文
摘要:Beef McNuggetsHubert ChenFarmer Brown's cows are up in arms, having heard that McDonalds is considering the introduction of a new product: Beef McNuggets. The cows are trying to find any possible way to put such a product in a negative light.One strategy the cows are pursuing is that of `inferio
阅读全文
摘要:威威猫系列故事——过生日Time Limit: 500/200 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 640Accepted Submission(s): 160Problem Description 2月29号是威威猫的生日,由于这个日子非常特殊,4年才一次,所以生日这天许多朋友都前往威威猫家祝贺他的生日。 大家给威威猫买了一个非常大非常大的蛋糕,蛋糕的形状是一个有n条边的凸多边形,可是威威猫的审美观有一点奇怪,他只喜欢有m条边的蛋糕,所以他要伙伴们把这个蛋糕切p次,然后..
阅读全文
摘要:小明系列故事——买年货Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 831 Accepted Submission(s): 335Problem Description 春节将至,小明要去超市购置年货,于是小明去了自己经常去的都尚超市。 刚到超市,小明就发现超市门口聚集一堆人。用白云女士的话说就是:“那家伙,那场面,真是人山人海,锣鼓喧天,鞭炮齐呤,红旗招展。那可真是相当的壮观啊!”。好奇的小明走过去,奋力挤过人群,发现超市门口贴了一张..
阅读全文
摘要:吉哥系列故事——完美队形IITime Limit: 3000/1000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 365Accepted Submission(s): 106Problem Description 吉哥又想出了一个新的完美队形游戏! 假设有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] ... h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则就是新的完美队形: 1、挑出的人保持原队形的相对顺序不变,且必...
阅读全文
摘要:最长回文Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4331Accepted Submission(s): 1438Problem Description给出一个只由小写英文字符a,b,c...y,z组成的字符串S,求S中最长回文串的长度.回文就是正反读都是一样的字符串,如aba, abba等Input输入有多组case,不超过120组,每组输入为一行小写英文字符a,b,c...y,z组成的字符串S两组case之间由空行隔开(该空行不用处理
阅读全文
摘要:湫湫系列故事——设计风景线Time Limit: 6000/3000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 676Accepted Submission(s): 219Problem Description 随着杭州西湖的知名度的进一步提升,园林规划专家湫湫希望设计出一条新的经典观光线路,根据老板马小腾的指示,新的风景线最好能建成环形,如果没有条件建成环形,那就建的越长越好。 现在已经勘探确定了n个位置可以用来建设,在它们之间也勘探确定了m条可以设计的路线以及他们的长度。请..
阅读全文
摘要:吉哥系列故事——完美队形ITime Limit: 3000/1000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 587Accepted Submission(s): 130Problem Description 吉哥这几天对队形比较感兴趣。 有一天,有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] ... h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则称之为完美队形: 1、挑出的人保持他们在原队形的相对顺序不变;...
阅读全文
摘要:D -SaviorTime Limit:4000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 60DDescriptionMisha decided to help Pasha and Akim be friends again. He had a cunning plan — to destroy all the laughy mushrooms. He knows that the laughy mushrooms can easily burst when th
阅读全文
摘要:吉哥系列故事——临时工计划Time Limit : 3000/1000ms (Java/Other)Memory Limit : 65535/32768K (Java/Other)Total Submission(s) : 24Accepted Submission(s) : 5Font:Times New Roman|Verdana|GeorgiaFont Size:←→Problem Description 俗话说一分钱难倒英雄汉,高中几年下来,吉哥已经深深明白了这个道理,因此,新年开始存储一年的个人资金已经成了习惯,不过自从大学之后他不好意思再向大人要压岁钱了,只能把唯一的希望放到自己.
阅读全文
摘要:E -PentagonTime Limit:10000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 51EDescriptionAccording to the last order issued by the president of Berland every city of the country must have its own Ministry Defense building (their own Pentagon). A megapolis Berbo
阅读全文
摘要:C -Three Base StationsTime Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 51CDescriptionThe New Vasjuki village is stretched along the motorway and that's why every house on it is characterized by its shift relative to some fixed point — thexicoo
阅读全文
摘要:B -bHTML Tables AnalisysTime Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 51BDescriptionIn this problem is used an extremely simplified version of HTML table markup. Please use the statement as a formal document and read it carefully.A string is a
阅读全文
摘要:Closed FencesA closed fence in the plane is a set of non-crossing, connected line segments with N corners (3 #include
#include
#include
using namespace std;
const double ex=1e-10;
const int mm=2100;
class _point
{ public:double x,y; _point(double xx,double yy){x=xx;y=yy;} _point(){}
};
class ...
阅读全文
摘要:E -Square Equation RootsTime Limit:5000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 50EDescriptionA schoolboy Petya studies square equations. The equations that are included in the school curriculum, usually look simple:x2 + 2bx + c = 0whereb,care natural nu
阅读全文
摘要:http://acm.hdu.edu.cn/diy/contest_show.php?cid=186391001 畅通工程这题简单,只要把有连边的点合并。最后查看一下有几个不同的集合,集合数减1就是要建路的个数。1002 小希的迷宫本题实际上就是让你判断所给的边组成的是不是一棵树,本题是无向树,无向树是任意两点有且仅有一条通路,也就是没回路且联通。因此,每读入一条边,先判断该两点是否已经通了,在同一个集合,是就说明不是一棵树,不是就合并这两个集合。同时看这两个顶点是否出现过,如果没出现则需要记录一下。等这些工作完成后,在遍历一下出现过的顶点如果全在一个集合就说明是树,否则就不是。1003Far
阅读全文
摘要:D -NotepadTime Limit:2000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 17DDescriptionNick is attracted by everything unconventional. He doesn't like decimal number system any more, and he decided to study other number systems. A number system with basebcau
阅读全文
摘要:Find them, Catch themTime Limit:1000MSMemory Limit:10000KTotal Submissions:23593Accepted:7066DescriptionThe police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon and Gang Snake. However, the police first needs to identify whi
阅读全文
摘要:Power NetworkTime Limit:2000MSMemory Limit:32768KTotal Submissions:19534Accepted:10300DescriptionA 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
阅读全文
摘要:Raucous RockersYou just inherited the rights to N (1 #include
using namespace std;
ifstream cin("rockers.in");
ofstream cout("rockers.out");
const int mm=33;
class node
{ public:int t,c; node(){t=c=0;}
}dp[mm][mm];
int n,t,m;
int s[mm];
int main()
{ while(cin>>n>>t>
阅读全文
摘要:Electric FenceDon PieleIn this problem, `lattice points' in the plane are points with integer coordinates.In order to contain his cows, Farmer John constructs a triangular electric fence by stringing a "hot" wire from the origin (0,0) to a lattice point [n,m] (00), and then back to the
阅读全文
摘要:Bracket sequenceGiven stringsmade up with(,),?, count the way to substitude?with(or)to form regular bracket sequence.InputA strings.(1≤|s|≤1000)OuptutAn integer denotes the number of ways modulo(109+7).Sample input????Sample output2思路:dp[x][y]字符串长为x时,左括号还有y个未匹配。#include
#include
using namespace std;
阅读全文
摘要:E. Ivan the Fool VS Gorynych the Dragontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOnce upon a time in a kingdom far, far away… Okay, let’s start at the point where Ivan the Fool met Gorynych the Dragon. Ivan took out his magic sword and the
阅读全文
摘要:Longest path on DAGFind the longest path on directed acyclic graphG.InputThe first line contains two integersn,m, which denote the number of vertices and edges.The followingmlines contains two integerai,bi, which denote edgeai→bi.(1≤n≤105,1≤m≤106,1≤ai
#include
using namespace std;
const int mm=6e6+9
阅读全文
摘要:PackingThe cost of set{(a1,b1),(a2,b2),…,(an,bn)}is defined asmax{ai}×max{bi}Partition set{(a1,b1),(a2,b2),…,(an,bn)}into several non-empty subsets to minimize the sum of the cost of subsets.InputThe first line contains an integern.nlines follow. Each of them contains two integerai,bi.(1≤n≤1000
阅读全文
摘要:Geometric sumCompute(a+a2+…an)modm.InputThree integersa,n,m.(1≤a,n,m≤1018)OutputThe only integer denotes the result.Sample input2 2 1000000000Sample output6 思路;看代码吧#include
#include
using namespace std;
long long c,x,n;
long long mul(long long a,long long b)///(a*b)%c
{ long long ret=0; a%=c;b%=c;..
阅读全文
摘要:American HeritageFarmer John takes the heritage of his cows very seriously. He is not, however, a truly fine bookkeeper. He keeps his cow genealogies as binary trees and, instead of writing them in graphic form, he records them in the more linear `tree in-order' and `tree pre-order' notation
阅读全文
摘要:C. Dancing Lessonstime limit per test5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere arenpeople taking dancing lessons. Every person is characterized by his/her dancing skillai. At the beginning of the lesson they line up from left to right. While there is at
阅读全文
摘要:D. Event Datestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOn a history lesson the teacher asked Vasya to name the dates whennfamous events took place. He doesn't remembers the exact dates but he remembers a segment of days[li, ri](inclusi
阅读全文
摘要:食物链Time Limit:1000MSMemory Limit:10000KTotal Submissions:33156Accepted:9626Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述:第一种说法是"1 X Y",表示X和Y是同类。第二种说法是"2 X Y",表示X吃Y。此人对N个动物,用上述两种说法,一句接一句地说出K句话,这K句
阅读全文
摘要:find the most comfortable roadTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1864Accepted Submission(s): 779Problem DescriptionXX星有许多城市,城市之间通过一种奇怪的高速公路SARS(Super Air Roam Structure---超级空中漫游结构)进行交流,每条SARS都对行驶在上面的Flycar限制了固定的Speed,同时XX星人对 Flycar的“舒适
阅读全文
摘要:More is betterTime Limit: 5000/1000 MS (Java/Others)Memory Limit: 327680/102400 K (Java/Others)Total Submission(s): 8057Accepted Submission(s): 3001Problem DescriptionMr Wang wants some boys to help him with a project. Because the project is rather complex,the more boys come, the better it will be.
阅读全文
摘要:Optimal MilkingTime Limit:2000MSMemory Limit:30000KTotal Submissions:9253Accepted:3341Case 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 .
阅读全文
摘要:Drainage DitchesTime Limit:1000MSMemory Limit:10000KTotal Submissions:45239Accepted:17002DescriptionEvery time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long time to regrow.
阅读全文
摘要:PIGSTime Limit:1000MSMemory Limit:10000KTotal Submissions:13190Accepted:5843DescriptionMirko works on a pig farm that consists of M locked pig-houses and Mirko can't unlock any pighouse because he doesn't have the keys. Customers come to the farm one after another. Each of them has keys to s
阅读全文
摘要:CodeTime Limit:1000MSMemory Limit:65536KTotal Submissions:1645Accepted:625DescriptionKEY Inc., the leading company in security hardware, has developed a new kind of safe. To unlock it, you don't need a key but you are required to enter the correct n-digit code on a keypad (as if this were someth
阅读全文
摘要:Play on WordsTime Limit:1000MSMemory Limit:10000KTotal Submissions:7826Accepted:2759DescriptionSome of the secret doors contain a very interesting word puzzle. The team of archaeologists has to solve it to open that doors. Because there is no other way to open the doors, the puzzle is very important
阅读全文
摘要:Door ManTime Limit:1000MSMemory Limit:10000KTotal Submissions:1598Accepted:596DescriptionYou are a butler in a large mansion. This mansion has so many rooms that they are merely referred to by number (room 0, 1, 2, 3, etc...). Your master is a particularly absent-minded lout and continually leaves d
阅读全文
摘要:IntervalsTime Limit:2000MSMemory Limit:65536KTotal Submissions:18338Accepted:6869DescriptionYou are given n closed, integer intervals [ai, bi] and n integers c1, ..., cn.Write a program that:reads the number of intervals, their end points and integers c1, ..., cn from the standard input,computes the
阅读全文

浙公网安备 33010602011771号