02 2013 档案
摘要:Burn the Linked CampTime Limit: 2 Seconds Memory Limit: 65536 KB It is well known that, in the period of The Three Empires, Liu Bei, the emperor of the Shu Empire, was defeated by Lu Xun, a general of the Wu Empire. The defeat was due to Liu Bei's wrong decision that he divided his large troops
阅读全文
摘要:Heavy CargoTime Limit:1000MSMemory Limit:65536KTotal Submissions:2614Accepted:1445DescriptionBig Johnsson Trucks Inc. is a company specialized in manufacturing big trucks. Their latest model, the Godzilla V12, is so big that the amount of cargo you can transport with it is never limited by the truck
阅读全文
摘要:Fiber NetworkTime Limit:1000MSMemory Limit:65536KTotal Submissions:2611Accepted:1195DescriptionSeveral startup companies have decided to build a better Internet, called the "FiberNet". They have already installed many nodes that act as routers all around the world. Unfortunately, they star
阅读全文
摘要:WormholesTime Limit:2000MSMemory Limit:65536KTotal Submissions:22566Accepted:8056DescriptionWhile exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a time that is BEFORE
阅读全文
摘要:Silver Cow PartyTime Limit:2000MSMemory Limit:65536KTotal Submissions:9514Accepted:4263DescriptionOne cow from each ofNfarms (1 ≤N≤ 1000) conveniently numbered 1..Nis going to attend the big cow party to be held at farm #X(1 ≤X≤N). A total ofM(1 ≤M≤ 100,000) unidirectional (one-way roads connects pa
阅读全文
摘要:ArbitrageTime Limit:1000MSMemory Limit:65536KTotal Submissions:11886Accepted:5000DescriptionArbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 US Dollar buys 0.5 British pound,
阅读全文
摘要:取石子游戏Time Limit:1000MSMemory Limit:10000KTotal Submissions:29959Accepted:9818Description有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆中同时取走相同数量的石子。最后把石子全部取完者为胜者。现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取最好的策略,问最后你是胜者还是败者。Input输入包含若干行,表示若干种石子的初始情况,其中每一行包含两个非负整数a和b,表示两堆石子的数目,a和b都不大于1,00
阅读全文
摘要:Yukari's BirthdayTime Limit: 12000/6000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 883Accepted Submission(s): 151Problem DescriptionToday is Yukari's n-th birthday. Ran and Chen hold a celebration party for her. Now comes the most important part, birthday c
阅读全文
摘要:A very hard mathematic problemTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2581Accepted Submission(s): 747Problem Description Haoren is very good at solving mathematic problems. Today he is working a problem like this: Find three positive inte..
阅读全文
摘要:Cube StackingTime Limit:2000MSMemory Limit:30000KTotal Submissions:15705Accepted:5331Case Time Limit:1000MSDescriptionFarmer John and Betsy are playing a game with N (1 #include
using namespace std;
const int mm=100010;
class node
{ public:int r,u,dis;
}g[mm];
int m;
void dataset()
{ for(int i=...
阅读全文
摘要:Idiomatic Phrases GameTime Limit: 2 Seconds Memory Limit: 65536 KB Tom is playing a game called Idiomatic Phrases Game. An idiom consists of several Chinese characters and has a certain meaning. This game will give Tom two idioms. He should build a list of idioms and the list starts and ends with th
阅读全文
摘要:Domino EffectTime Limit:1000MSMemory Limit:65536KTotal Submissions:6322Accepted:1609DescriptionDid you know that you can use domino bones for other things besides playing Dominoes? Take a number of dominoes and build a row by standing them on end with only a small distance in between. If you do it r
阅读全文
摘要:The Unique MSTTime Limit:1000MSMemory Limit:10000KTotal Submissions:16068Accepted:5566DescriptionGiven a connected undirected graph, tell if its minimum spanning tree is unique.Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning tree of G is a subgraph of G, s
阅读全文
摘要:E - TV GameCrawling in process...Crawling failedTime Limit:2000MSMemory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmitStatus DescriptionThere is a new TV game on BerTV. In this game two players get a number A consisting of 2n digits. Before each turn players determine who will make the next
阅读全文
摘要:NetworkTime Limit:1000MSMemory Limit:30000KTotal Submissions:11041Accepted:4200Special JudgeDescriptionAndrew is working as system administrator and is planning to establish a new network in his company. There will be N hubs in the company, they can be connected to each other using cables. Since eac
阅读全文
摘要:NetworkTime Limit: 2 Seconds Memory Limit: 65536 KB Special Judge Andrew is working as system administrator and is planning to establish a new network in his company. There will be N hubs in the company, they can be connected to each other using cables. Since each worker of the company must have acc
阅读全文
摘要:SwordfishTime Limit: 2 Seconds Memory Limit: 65536 KB There exists a world within our worldA world beneath what we call cyberspace.A world protected by firewalls,passwords and the most advancedsecurity systems.In this world we hideour deepest secrets,our most incriminating information,and of course,
阅读全文
摘要:D - King's Problem?Crawling in process...Crawling failedTime Limit:3000MSMemory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmitStatus Practice CodeForces 30D DescriptionEvery true king during his life must conquer the world, hold the Codeforces world finals, win pink panda in the shooting
阅读全文
摘要:Sorting It All OutTime Limit: 2 Seconds Memory Limit: 65536 KB An ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to largest. For example, the sorted sequence A, B, C, D implies that A #include
#include
#incl.
阅读全文
摘要:Bus PassTime Limit: 5 Seconds Memory Limit: 32768 KB You travel a lot by bus and the costs of all the seperate tickets are starting to add up.Therefore you want to see if it might be advantageous for you to buy a bus pass.The way the bus system works in your country (and also in the Netherlands) is
阅读全文
摘要:RescueTime Limit: 2 Seconds Memory Limit: 65536 KB Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M #include
#include
#include
using namespace std;
const int oo=1e9;
const int mm=233;
const int dx[]={1,-1,0,0};
const int dy[]={0,0,1,-1};
int.
阅读全文
摘要:Gnome TetravexTime Limit: 10 Seconds Memory Limit: 32768 KB Hart is engaged in playing an interesting game, Gnome Tetravex, these days. In the game, at the beginning, the player is given n*n squares. Each square is divided into four triangles marked four numbers (range from 0 to 9). In a square, the
阅读全文
摘要:C - Mail StampsCrawling in process...Crawling failedTime Limit:2000MSMemory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmitStatus Practice CodeForces 29C DescriptionOne day Bob got a letter in an envelope. Bob knows that when Berland's post officers send a letter directly from city«A
阅读全文
摘要:D - Ant on the TreeCrawling in process...Crawling failedTime Limit:2000MSMemory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmitStatus DescriptionConnected undirected graph without cycles is called a tree. Trees is a class of graphs which is interesting not only for people, but for ants too.An
阅读全文
摘要:E - Number With The Given Amount Of DivisorsCrawling in process...Crawling failedTime Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusPractice CodeForces 27E DescriptionGiven the number n, find the smallest positive integer which has exactlyn divisors. It is guaranteed
阅读全文
摘要:D. Ring Road 2time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIt is well known that Berland hasncities, which form the Silver ring — citiesiandi + 1(1 ≤ i #include
using namespace std;
const int mm=110;
int a[mm],b[mm],c[mm];
int n,m;
bool flag;.
阅读全文
摘要:Divisor counting (Easy)Let σ(n)denote the number of divisors of n.Compute σ(1)+σ(2)+⋯+σ(n).InputAn integer n.(1≤n≤108)OutputThe sum.Sample input5Sample output10思路:计算 [1, X]区间内所有数字的因子个数之和这个等价于X / 1 + X / 2 + ... + X / X, 这里注意是整除,直接暴力(O(X)超时),所以就要分段求; 例如:X/[i………j]==X[k](i
#include
using namespace std;
阅读全文
摘要:XorFor given multisets AandB, find minimum non-negative xwhichA⊕x=B.Note that for A={a1,a2,…,an},A⊕x={a1⊕x,a2⊕x,…,an⊕x}.⊕stands for exclusive-or.InputThe first line contains a integer n, which denotes the size of set A(also for B).The second line contains nintegersa1,a2,…,an, which denote the set A.
阅读全文
摘要:Square freeTest whether nis square free. nis square free if and only if for all p>1,p2is not divisors of n.InputThe first line contains an integer t, the number of test cases.The following nlines, each contains an integer n.(1≤t≤102,1≤n≤1018)OutputPrint "Yes" if nis square free, or &quo
阅读全文
摘要:BabelfishTime Limit: 3000MSMemory Limit: 65536KTotal Submissions: 26420Accepted: 11341DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.InputInput consist
阅读全文
摘要:C - ParquetCrawling in process...Crawling failedTime Limit:2000MSMemory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmitStatus Practice CodeForces 26C DescriptionOnce Bob decided to lay a parquet floor in his living room. The living room is of sizen × m metres. Bob had planks of three typ
阅读全文
摘要:Farm IrrigationTime Limit: 2 Seconds Memory Limit: 65536 KB Benny has a spacious farm land to irrigate. The farm land is a rectangle, and is divided into a lot of samll squares. Water pipes are placed in these squares. Different square has a different type of pipe. There are 11 types of pipes, which
阅读全文
摘要:Tempter of the BoneTime Limit: 2 Seconds Memory Limit: 65536 KB The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He realized that the bone was a trap, and he tried desperately
阅读全文
摘要:Frogs' NeighborhoodTime Limit:5000MSMemory Limit:10000KTotal Submissions:5524Accepted:2388Special JudgeDescription未名湖附近共有N个大小湖泊L1,L2, ...,Ln(其中包括未名湖),每个湖泊Li里住着一只青蛙Fi(1 ≤i≤N)。如果湖泊Li和Lj之间有水路相连,则青蛙Fi和Fj互称为邻居。现在已知每只青蛙的邻居数目x1,x2, ...,xn,请你给出每两个湖泊之间的相连关系。Input第一行是测试数据的组数T(0 ≤T≤ 20)。每组数据包括两行,第一行是整数N(2
阅读全文
摘要:Greatest Common Increasing SubsequenceTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2081Accepted Submission(s): 626Problem DescriptionThis is a problem from ZOJ 2432.To make it easyer,you just need output the length of the subsequence.InputEach s
阅读全文
摘要:重温世界杯Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3018Accepted Submission(s): 944Problem Description世界杯结束了,意大利人连本带利的收回了法国人6年前欠他们的债,捧起了大力神杯,成就了4星意大利.世界杯虽然结束了,但是这界世界杯给我们还是留下许多值得回忆的东西.比如我们听到了黄名嘴的3分钟激情解说,我们懂得了原来可以向同一个人出示3张黄牌,我们还看到了齐达内的头不仅能顶球还能顶人…………
阅读全文
摘要:搬寝室Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10915Accepted Submission(s): 3661Problem Description搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是xhd决定随便搬2*k件过去就行了.但还是会很累,因为2*k也不小是一个不大于n
阅读全文
摘要:E - TestCrawling in process...Crawling failedTime Limit:2000MSMemory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmitStatus Practice CodeForces 25E DescriptionSometimes it is hard to prepare tests for programming problems. Now Bob is preparing tests to new problem about strings — input data to
阅读全文
摘要:D - Roads not only in BerlandCrawling in process...Crawling failedTime Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 25D DescriptionBerland Government decided to improve relations with neighboring countries. First of all, it was decided to build new
阅读全文
摘要:C - Roads in BerlandCrawling in process...Crawling failedTime Limit:2000MSMemory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmitStatus Practice CodeForces 25C DescriptionThere are n cities numbered from 1 to n in Berland. Some of them are connected by two-way roads. Each road has its own leng
阅读全文

浙公网安备 33010602011771号