QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#206782 | #7558. Abstract | ucup-team206# | Compile Error | / | / | C++14 | 521b | 2023-10-07 22:44:14 | 2023-10-07 22:44:14 |
Judging History
answer
n, m = map(int, input().split())
a = list(map(int, input().split()))
g = [[] for i in range(n)]
deg = [0] * n
for i in range(m):
x, y = map(int, input().split())
x -= 1
y -= 1
g[x].append(y)
deg[y] += 1
q = []
h = 0
for i in range(n):
if deg[i] == 0:
q.append(i)
ans = 0
while h < len(q):
x = q[h]
ans = a[x]
h += 1
for y in g[x]:
a[y] += a[x] * 2
deg[y] -= 1
if deg[y] == 0:
q.append(y)
print(len(bin(ans)) - 2)
详细
answer.code:1:1: error: ‘n’ does not name a type 1 | n, m = map(int, input().split()) | ^