题目描述 Farmer John has forgotten to repair a hole in the fence on his farm, and his N cows (1 <= N <= 1,000) have escaped and gone on a rampage! Each mi ...
分类:
其他好文 时间:
2018-09-22 21:22:29
阅读次数:
188
一道简单的树形DP送给你。 A couple of years ago, a new world wide crisis started, leaving many people with economical problems. Some workers of a particular compa ...
分类:
其他好文 时间:
2018-09-09 18:01:18
阅读次数:
204
题目描述 In an effort to better manage the grazing patterns of his cows, Farmer John has installed one-way cow paths all over his farm. The farm consists ...
分类:
其他好文 时间:
2018-09-06 10:59:29
阅读次数:
155
基环树森林,然而我比较菜,直接tarjan找环。 发现缩点之后变成了DAG,每一个点往下走一定会走到一个环,缩点之后搜一遍看看会走到哪个环以及那个环的编号是多少,答案就是环的$siz$$ + $要走的路程。 比较垃圾的我忘记了判重边WA了好多发…… 时间复杂度$O(n)$。 Code: #inclu ...
分类:
其他好文 时间:
2018-09-06 02:31:26
阅读次数:
168
嘟嘟嘟 这道题有一个特别重要的一点,就是节点数为 n 的图只有 n 条边,于是就有一下几个性质: 1.每一个点的出度都为1。 2.一个k个节点的强连通分量都是有k条边的环,而且这个环不会通往其他的点,只可能有别的点通往这个环。 所以说,对于一个在环中的点,答案就是这个环的节点数(包括自环),对于一个 ...
分类:
其他好文 时间:
2018-08-25 18:41:55
阅读次数:
243
A - Garden Problem Statement There is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical road and a ho ...
分类:
其他好文 时间:
2018-08-19 17:09:13
阅读次数:
301
Description One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ ...
分类:
其他好文 时间:
2018-08-18 17:42:41
阅读次数:
163
Making the Grade (简洁题意请往下翻) Description A straight dirt road connects two fields on FJ's farm, but it changes elevation more than FJ would like. His c ...
分类:
其他好文 时间:
2018-08-18 14:26:20
阅读次数:
263
题目传送门 Roadblocks Description Bessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to ge ...
分类:
数据库 时间:
2018-08-17 20:02:43
阅读次数:
182
原题如下: Roadblocks Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 19314 Accepted: 6777 Description Bessie has moved to a small farm and some ...
分类:
数据库 时间:
2018-08-12 01:34:47
阅读次数:
173