Invitation Cards
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 2374 Accepted Submission(s): 1151
Problem Description
In the age o...
分类:
其他好文 时间:
2015-03-29 21:04:10
阅读次数:
148
Saving James Bond
Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 2405 Accepted Submission(s): 454
Problem Description
This time let...
分类:
其他好文 时间:
2015-03-29 16:39:22
阅读次数:
144
题型1:拓扑排序1)使用一个入度数组indegree来记录每个顶点的入度数,并使用一个变量来记录已经访问的顶点数2)将入度为0的顶点压入栈中3)将栈顶的元素删除。访问的顶点数加1.并将入该顶点相邻的所有顶点的入度数减1,如果减1之后的入度数为0,则将其压入栈中;4)重复上面的过程,直到栈中的元素为空...
分类:
编程语言 时间:
2015-03-28 01:04:03
阅读次数:
117
算法的思想就不多说了。主要对代码解释一下。
graph = [[0,4,3,2],
[4,0,1,4],
[3,1,0,2],
[2,4,2,0]]
n = 4
flags = [True,True,True,True]
queue = []
#flags是存储节点访问情况的,true为待访问节点
#queue存储节点访问顺序
que...
分类:
编程语言 时间:
2015-03-27 22:28:04
阅读次数:
186
edge = [[1,2,1],[1,2,3],[1,3,2],[2,3,1],[2,4,4],[3,4,2]]
#这是用边集合表示的图
s = [[]]
n = 4
for i in range(n):
s.append([i+1])
#print s
#compare方法是为了对边排序写的,作为参数传入sort,就可以排序了
def compare(a,b):
if(a[2...
分类:
编程语言 时间:
2015-03-27 22:26:43
阅读次数:
242
双连通缩点+求树的直径,图论基础题目。 1 /* 4612 */ 2 #pragma comment(linker, "/STACK:1024000000,1024000000") 3 #include 4 #include 5 #include 6 #include 7 #i...
分类:
其他好文 时间:
2015-03-20 23:26:12
阅读次数:
203
Genghis Khan the Conqueror
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 327680/327680 K (Java/Others)
Total Submission(s): 1687 Accepted Submission(s): 501
Problem Description
G...
分类:
其他好文 时间:
2015-03-20 18:36:16
阅读次数:
126
Subway
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 6692
Accepted: 2177
Description
You have just moved from a quiet Waterloo neighbourhood to a big,...
分类:
其他好文 时间:
2015-03-20 09:21:12
阅读次数:
142
Problem Description
In order to get rid of Conan, Kaitou KID disguises himself as a teacher in the kindergarten. He knows kids love games and works out a new game called "hand in hand".
Initiall...
分类:
其他好文 时间:
2015-03-19 23:59:41
阅读次数:
435
1614. National Project “Trams”
Time limit: 0.5 second
Memory limit: 64 MB
President has declared the development of tram service a priority national project. As a part of this project, Yeka...
分类:
其他好文 时间:
2015-03-19 18:32:12
阅读次数:
145