题目描述 每年万圣节,威斯康星的奶牛们都要打扮一番,出门在农场的N个牛棚里转 悠,来采集糖果.她们每走到一个未曾经过的牛棚,就会采集这个棚里的1颗糖果. 农场不大,所以约翰要想尽法子让奶牛们得到快乐.他给每一个牛棚设置了一个“后继牛 棚”.牛棚i的后继牛棚是next_i 他告诉奶牛们,她们到了一个牛 ...
分类:
其他好文 时间:
2016-11-01 07:40:19
阅读次数:
166
Claris大爷出的一套模拟题。问别人要到了一份题,加深了自己NOIp要滚粗的感觉。 Matser zzDP题,我只能说我第一遍写的时候还写崩了QAQ。 Tour 通过这道题学到了bitset的简单用法,很实用。 那道题的时候想了想搞到了70分的做法,卡在了如何$O(1)$求三元环的算法上,事实证明 ...
分类:
其他好文 时间:
2016-10-23 11:36:35
阅读次数:
341
10.1. Operating System Interface The os module provides dozens of functions for interacting with the operating system: >>> >>> import os >>> os.getcwd ...
分类:
其他好文 时间:
2016-10-22 17:55:07
阅读次数:
301
Tour Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 4307 Accepted: 1894 Description John Doe, a skilled pilot, enjoys traveling. While on ...
分类:
其他好文 时间:
2016-10-19 02:44:07
阅读次数:
188
2016.10.06 //貌似是bzoj十连测???orz。。。I know nothing about it. (T1)master(100/100):我直接二分了QAQ......题解是暴力+贪心,,好有道理的样子......还有人用dp,不明觉厉 (T2)tour(70/100):70%:O( ...
分类:
其他好文 时间:
2016-10-07 11:25:43
阅读次数:
133
Farmer John has a number of pastures on his farm. Cow paths connect some pastures with certain other pastures, forming a field. But, at the present ti ...
分类:
其他好文 时间:
2016-10-04 16:30:11
阅读次数:
223
题目描述 Farmer John and his cows are planning to leave town for a long vacation, and so FJ wants to temporarily close down his farm to save money in the ...
分类:
其他好文 时间:
2016-10-03 06:54:50
阅读次数:
165
题意:一个团队要去参观一些学校,某些学校要在某些学校之前先参观,并且每个学校有一个权值,团队去的时间与权值的差作为难过度(最小是0), 所有的难过度的最大值是伤心度,让你安排参观顺序,使得这个伤心度最小。 析:拓扑排序,并且要逆序排,这样的话,时间大的优先,可以用优先队列实现。 代码如下: ...
分类:
编程语言 时间:
2016-10-01 15:03:05
阅读次数:
212
Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 11334 Accepted: 5222 Description The cows have reconstructed Farmer John's farm, with its N ...
分类:
其他好文 时间:
2016-09-29 01:38:35
阅读次数:
157
bzoj1589[Usaco2008 Dec]Trick or Treat on the Farm 采集糖果 题意: n个节点,每个节点有一个后继节点,问从每个节点出发能到多少个没去过的节点。n≤100000。 题解: 因为每个节点只有一个后继节点,所有tarjan缩点后就会变成一堆链,对每条链df ...
分类:
其他好文 时间:
2016-09-25 17:22:45
阅读次数:
155