QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#77299#1481. Strahler OrderYiyayuCompile Error//C++14479b2023-02-13 23:46:032023-02-13 23:46:04

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-13 23:46:04]
  • 评测
  • [2023-02-13 23:46:03]
  • 提交

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] == holds[end-1] == 0:
			holds[start-1] = holds[end-1] = 1
		else:
			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(str(setNum) + ' ' + str(max(holds)))
	



详细

answer.code:1:1: error: ‘num’ does not name a type; did you mean ‘enum’?
    1 | num = int(input())
      | ^~~
      | enum