QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#77304#1481. Strahler OrderYiyayuWA 9ms7864kbPython3452b2023-02-14 00:16:462023-02-14 00:16:50

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-14 00:16:50]
  • 评测
  • 测评结果:WA
  • 用时:9ms
  • 内存:7864kb
  • [2023-02-14 00:16:46]
  • 提交

answer

num = int(input())

for i in range(num):
	setNum, nodes, edges = (int(j) for j in input().split())
	holds = [0] * nodes
	for t in range(edges):
		start, end = (int(x) for x in input().split())
		if holds[start-1] == 0:
			holds[start-1] = 1
		if holds[start-1] > holds[end-1]:
			holds[end-1] = holds[start-1]
		elif holds[start-1] == holds[end-1]:
			holds[end-1] += 1
		print(holds)
	#print(str(setNum) + ' ' + str(max(holds)))
	



Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 9ms
memory: 7864kb

input:

7
1 7 8
1 3
2 3
6 4
3 4
3 5
6 7
5 7
4 7
2 20 19
1 3
2 3
3 7
4 6
5 6
6 7
8 9
7 9
9 10
11 13
12 13
13 14
15 17
16 17
17 14
14 10
10 19
18 19
19 20
3 10 9
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
4 10 9
2 3
4 5
8 9
9 10
1 2
6 7
5 6
7 8
3 4
5 13 16
1 12
12 9
9 11
11 13
2 4
4 8
8 12
8 7
9 10
10 11
7 10
4 5
5...

output:

[1, 0, 1, 0, 0, 0, 0]
[1, 1, 2, 0, 0, 0, 0]
[1, 1, 2, 1, 0, 1, 0]
[1, 1, 2, 2, 0, 1, 0]
[1, 1, 2, 2, 2, 1, 0]
[1, 1, 2, 2, 2, 1, 1]
[1, 1, 2, 2, 2, 1, 2]
[1, 1, 2, 2, 2, 1, 3]
[1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[1...

result:

wrong answer 1st lines differ - expected: '1 3', found: '[1, 0, 1, 0, 0, 0, 0]'