摘要:
题意:放最少的士兵去监视所有的道路, 但士兵不可相邻分析:由於不可相邻可以視同為不可同色(分成两种颜色), 对于一個连通图而言, 如果可以用两种颜色涂完,那么较少使用的顏色则是放置士兵的个数。这题要小心有很多连通图 !#include#include#include#include#include#...
阅读全文
posted @ 2015-05-27 14:07
waterfull
阅读(473)
推荐(0)
摘要:
题解:整个数组是非降序的,所有相等元素都会聚集在一起。开一个num数组,用num[i]来记录第i段相等的元素有多少个(也就是说相当于RMQ中的元素值了),num数组的长度就是原数列不同元素的个数(段数),l数组记录i段元素的上界,r数组记录i段元素的下界,用一个mark数组记录i位置的元素属于第几段...
阅读全文
posted @ 2015-05-27 13:36
waterfull
阅读(209)
推荐(0)
摘要:
题意:有N个人竞选,有M个投票人,每个投票人对竞选者都有个排序.投票人对于两个竞选者,他会投排在前面的竞选者的票.每次有2个竞选人出来竞选,失败者退出,获胜者则回到竞选候选人里,直到最后一人.现在你想要某人S获胜,并且你能随意安排两个人出来竞选.分析:构图,每两个人A,B,若A获的票数大于B,则连A...
阅读全文
posted @ 2015-05-27 12:46
waterfull
阅读(208)
推荐(0)
摘要:
题意。。。某个数第n次出现的位置。。。#include#include#include#include#include#include#include#include#include#includeusing namespace std;int n,m;map > mp;int main(){ ...
阅读全文
posted @ 2015-05-27 11:01
waterfull
阅读(136)
推荐(0)
摘要:
题意: 给定n*n的矩阵,每个格子有个值s[i][j],现在要求对每行和每列各分配一个值,r[i],c[i]使得对所有的格子都有s[i][j]#include#include#include#include#include#include#include#include#includeusing ...
阅读全文
posted @ 2015-05-27 10:49
waterfull
阅读(270)
推荐(0)
摘要:
题目大意给你一个n个点m条边的无向无环图,在尽量少的节点上放灯,使得所有边都被照亮。每盏灯将照亮以它为一个端点的所有边。在灯的总数最小的前提下,被两盏灯同时被照亮的边数应该尽量大。这题教会了我一个很有用的技巧:有两个所求的值要优化,比如让a尽量小,b也尽量小那么可以转化为让M*a+b尽量小,其中M应...
阅读全文
posted @ 2015-05-27 10:26
waterfull
阅读(310)
推荐(0)
摘要:
C. King's Pathtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe black king is standing on a ch...
阅读全文
posted @ 2015-05-27 09:58
waterfull
阅读(377)
推荐(0)
摘要:
Watashi's BGTime Limit:3 Seconds Memory Limit:65536 KBWatashi is the couch of ZJU-ICPC Team and he is very kind hearted. In ZJU-ICPC summer training c...
阅读全文
posted @ 2015-05-27 09:29
waterfull
阅读(207)
推荐(0)
摘要:
题意:求两点之间路径中的最大值值最小,直接floyd#include#include#include#include#includeusing namespace std;int mp[105][105],n,m,q;void floyd(){ for(int k=1;kmp[k][j]?mp...
阅读全文
posted @ 2015-05-27 09:00
waterfull
阅读(133)
推荐(0)
摘要:
Let's go homeTime Limit: 10000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1523Accepted Submission(s): 616Probl...
阅读全文
posted @ 2015-05-26 19:47
waterfull
阅读(152)
推荐(0)
摘要:
http://wenku.baidu.com/link?url=xo0rr2Euamxkz3WOs7Nq66hZ4vrYfRQ3FWw98Z-fy37O8fOOBLUOnNpFNfS6WtfrAIUGZG2coxcrZhIqrDsFmLP1PboOr3XIGq9QFwn1b67PartyTime L...
阅读全文
posted @ 2015-05-26 18:41
waterfull
阅读(173)
推荐(0)
摘要:
IntervalsTime Limit:2000MSMemory Limit:65536KTotal Submissions:22781Accepted:8613DescriptionYou are given n closed, integer intervals [ai, bi] and n i...
阅读全文
posted @ 2015-05-26 18:12
waterfull
阅读(167)
推荐(0)
摘要:
Is the Information Reliable?Time Limit:3000MSMemory Limit:131072KTotal Submissions:11676Accepted:3687DescriptionThe galaxy war between the Empire Drac...
阅读全文
posted @ 2015-05-26 17:44
waterfull
阅读(225)
推荐(0)
摘要:
Get SauceTime Limit:5 Seconds Memory Limit:32768 KBIn order to celebrate the 8th anniversary of ZOJ, LCLL goes to a sauce factory to "Get Sauce". The ...
阅读全文
posted @ 2015-05-26 09:38
waterfull
阅读(373)
推荐(0)
摘要:
Prison BreakTime Limit:1 Second Memory Limit:32768 KBIn a prison, there areR*Crooms, and there are N prisoners in it, each in a room. For example: (R=...
阅读全文
posted @ 2015-05-26 09:11
waterfull
阅读(415)
推荐(0)
摘要:
1218: [HNOI2003]激光炸弹Time Limit:10 SecMemory Limit:162 MBSubmit:1292Solved:621[Submit][Status][Discuss]Description一种新型的激光炸弹,可以摧毁一个边长为R的正方形内的所有的目标。现在地图上...
阅读全文
posted @ 2015-05-25 19:20
waterfull
阅读(156)
推荐(0)
摘要:
【bzoj1345】[Baltic2007]序列问题Sequence2014年3月23日4512Description对于一个给定的序列a1, …, an,我们对它进行一个操作reduce(i),该操作将数列中的元素ai和ai+1用一个元素max(ai,ai+1)替代,这样得到一个比原来序列短的新序...
阅读全文
posted @ 2015-05-25 19:11
waterfull
阅读(848)
推荐(0)
摘要:
2054: 疯狂的馒头Time Limit:10 SecMemory Limit:162 MBSubmit:449Solved:175[Submit][Status]DescriptionInput第一行四个正整数N,M,p,qOutput一共输出N行,第i行表示第i个馒头的最终颜色(如果最终颜色是...
阅读全文
posted @ 2015-05-25 18:38
waterfull
阅读(156)
推荐(0)
摘要:
Labeling BallsTime Limit:1000MSMemory Limit:65536KTotal Submissions:11523Accepted:3313DescriptionWindy hasNballs of distinct weights from 1 unit toNun...
阅读全文
posted @ 2015-05-25 17:42
waterfull
阅读(263)
推荐(0)
摘要:
Frogs' NeighborhoodTime Limit:5000MSMemory Limit:10000KTotal Submissions:8215Accepted:3491Special JudgeDescription未名湖附近共有N个大小湖泊L1,L2, ...,Ln(其中包括未名湖),...
阅读全文
posted @ 2015-05-25 16:19
waterfull
阅读(511)
推荐(0)
摘要:
Channel AllocationTime Limit:1000MSMemory Limit:10000KTotal Submissions:12983Accepted:6649DescriptionWhen a radio station is broadcasting over a very ...
阅读全文
posted @ 2015-05-25 15:59
waterfull
阅读(158)
推荐(0)
摘要:
Desert KingTime Limit:3000MSMemory Limit:65536KTotal Submissions:21855Accepted:6103DescriptionDavid the Great has just become the king of a desert cou...
阅读全文
posted @ 2015-05-25 15:39
waterfull
阅读(125)
推荐(0)
摘要:
Full Tank?Time Limit:1000MSMemory Limit:65536KTotal Submissions:6724Accepted:2194DescriptionAfter going through the receipts from your car trip throug...
阅读全文
posted @ 2015-05-25 15:13
waterfull
阅读(177)
推荐(0)
摘要:
SightseeingTime Limit:2000MSMemory Limit:65536KTotal Submissions:7601Accepted:2700DescriptionTour operator Your Personal Holiday organises guided bus ...
阅读全文
posted @ 2015-05-25 14:34
waterfull
阅读(380)
推荐(0)
摘要:
King's QuestTime Limit:15000MSMemory Limit:65536KTotal Submissions:7838Accepted:2841Case Time Limit:2000MSDescriptionOnce upon a time there lived a ki...
阅读全文
posted @ 2015-05-25 11:58
waterfull
阅读(141)
推荐(0)
摘要:
Countries in WarTime Limit:1000MSMemory Limit:65536KTotal Submissions:2803Accepted:843DescriptionIn the year 2050, after different attempts of the UN ...
阅读全文
posted @ 2015-05-25 11:25
waterfull
阅读(161)
推荐(0)
摘要:
Father Christmas flymouseTime Limit:1000MSMemory Limit:131072KTotal Submissions:2887Accepted:966DescriptionAfter retirement as contestant from WHU ACM...
阅读全文
posted @ 2015-05-25 10:55
waterfull
阅读(180)
推荐(0)
摘要:
Going from u to v or from v to u?Time Limit:2000MSMemory Limit:65536KTotal Submissions:15294Accepted:4047DescriptionIn order to make their sons brave,...
阅读全文
posted @ 2015-05-25 10:15
waterfull
阅读(245)
推荐(0)
摘要:
Heavy TransportationTime Limit:3000MSMemory Limit:30000KTotal Submissions:22556Accepted:5987DescriptionBackgroundHugo Heavy is happy. After the breakd...
阅读全文
posted @ 2015-05-25 09:45
waterfull
阅读(129)
推荐(0)
摘要:
2208: [Jsoi2010]连通数Time Limit:20 SecMemory Limit:512 MBSubmit:1500Solved:612[Submit][Status][Discuss]DescriptionInput输入数据第一行是图顶点的数量,一个正整数N。 接下来N行,每行N个...
阅读全文
posted @ 2015-05-25 08:53
waterfull
阅读(164)
推荐(0)
摘要:
1102: [POI2007]山峰和山谷GrzTime Limit: 10 SecMemory Limit: 162 MBSubmit: 436Solved: 227[Submit][Status]DescriptionFGD小朋友特别喜欢爬山,在爬山的时候他就在研究山峰和山谷。为了能够让他对他的旅...
阅读全文
posted @ 2015-05-23 15:37
waterfull
阅读(227)
推荐(0)
摘要:
【bzoj1116】[POI2008]CLO2014年5月13日3470DescriptionByteotia城市有n个 towns m条双向roads. 每条 road 连接 两个不同的 towns ,没有重复的road. 你要把其中一些road变成单向边使得:每个town都有且只有一个入度Inp...
阅读全文
posted @ 2015-05-23 10:46
waterfull
阅读(429)
推荐(0)
摘要:
1800: [Ahoi2009]fly 飞行棋Time Limit:10 SecMemory Limit:64 MBSubmit:973Solved:808[Submit][Status][Discuss]Description给出圆周上的若干个点,已知点与点之间的弧长,其值均为正整数,并依圆周顺序...
阅读全文
posted @ 2015-05-23 09:55
waterfull
阅读(162)
推荐(0)
摘要:
2463: [中山市选2009]谁能赢呢?Time Limit:10 SecMemory Limit:128 MBSubmit:969Solved:703[Submit][Status][Discuss]Description小明和小红经常玩一个博弈游戏。给定一个n×n的棋盘,一个石头被放在棋盘的左...
阅读全文
posted @ 2015-05-23 09:06
waterfull
阅读(144)
推荐(0)
摘要:
Dual Core CPUTime Limit:15000MSMemory Limit:131072KTotal Submissions:20366Accepted:8824Case Time Limit:5000MSDescriptionAs more and more computers are...
阅读全文
posted @ 2015-05-23 00:23
waterfull
阅读(154)
推荐(0)
摘要:
DescriptionBessie has two crisp red apples to deliver to two of her friends in the herd. Of course, she travels the C (1 6-> 7 -> 4* -> 3 -> 2 -> 1* ...
阅读全文
posted @ 2015-05-22 10:22
waterfull
阅读(388)
推荐(0)
摘要:
Description奶 牛们没钱了,正在找工作。农夫约翰知道后,希望奶牛们四处转转,碰碰运气。而且他还加了一条要求:一头牛在一个城市最多只能赚D(1 #include#include#include#include#include#include#include#include#include#i...
阅读全文
posted @ 2015-05-22 09:43
waterfull
阅读(205)
推荐(0)