QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#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)
Details
answer.code:1:1: error: ‘n’ does not name a type 1 | n, m = map(int, input().split()) | ^