Road Construction
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 8652
Accepted: 4323
Description
It's almost summer time, and that means that it's almost ...
分类:
其他好文 时间:
2014-08-05 22:42:30
阅读次数:
240
最短路问题。Dijkstra,SPFA,Floyd 都可求。题意非常明了,求最安全的路,乘起来就好了。有个小优化就是SPFA 算过的起点就不再去算了。还有推断一下终点,開始没推断,WA了一发。#include#include#include#include#include#include#inclu...
分类:
其他好文 时间:
2014-08-04 14:04:07
阅读次数:
175
UVA 1455 - Kingdom
题目链接
题意:给定一些城市坐标点,连在一起的城市称为一个州,现在用两种操作,road表示把城市a,b建一条路,line表示询问一个y轴上穿过多少个州,和这些州共包含多少个城市
思路:利用并查集维护每个州的上界和下界还有城市个数,然后每次加进一条路的时候,根据两个集合的位置可以处理出区间的州和城市数如何进行加减,然后利用线段树搞就可以了...
分类:
其他好文 时间:
2014-08-03 15:19:55
阅读次数:
296
贪心+并查集fighting~~~~~!! 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 #define maxn 300 7 #define INF 0x3fffffff 8 int par[maxn]; ...
分类:
其他好文 时间:
2014-07-27 21:36:35
阅读次数:
182
H. Qin Shi Huang's National Road SystemTime Limit: 1000msMemory Limit: 32768KB64-bit integer IO format:%I64d Java class name:MainDuring the Warring St...
分类:
其他好文 时间:
2014-07-23 15:07:06
阅读次数:
291
Chanel brand is taking the high road, stylish simplicity, simple and comfortable, pure style. "Fashion passes, style remains" still the guiding force ...
分类:
其他好文 时间:
2014-07-22 00:27:37
阅读次数:
268
Description
During the Warring States Period of ancient China(476 BC to 221 BC), there were seven kingdoms in China -- they were Qi, Chu, Yan, Han, Zhao, Wei and Qin. Ying Zheng was the king of the...
分类:
其他好文 时间:
2014-07-21 23:27:49
阅读次数:
437
find the safest road
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 6380 Accepted Submission(s): 2271
Problem Description
XX星球有很多城...
分类:
其他好文 时间:
2014-07-20 22:18:33
阅读次数:
232
#include #include #include using namespace std;int main(){ string s("Somewhere down the road"); istringstream iss(s); while (iss) ...
分类:
编程语言 时间:
2014-07-19 23:13:54
阅读次数:
248
最短路问题。
Dijkstra,SPFA,Floyd 都可求。题意很明了,求最安全的路,乘起来就好了。
有个小优化就是SPFA 算过的起点就不再去算了。
还有判断一下终点,开始没判断,WA了一发。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#inc...
分类:
其他好文 时间:
2014-07-19 02:45:06
阅读次数:
183