QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#205959#7558. Abstractucup-team052#WA 15ms9100kbPython3584b2023-10-07 17:56:452023-10-07 18:00:50

Judging History

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

  • [2023-10-07 18:00:50]
  • 评测
  • 测评结果:WA
  • 用时:15ms
  • 内存:9100kb
  • [2023-10-07 17:56:45]
  • 提交

answer

n, m = map(int, input().split())
a = list(map(int, input().split()))

u = [0 for i in range(m)]
v = [0 for i in range(m)]

for i in range(m) :
    u[i], v[i] = map(int, input().split())
    u[i] = u[i] - 1
    v[i] = v[i] - 1

ans = 0
while 1 :
    flag = 0
    for i in range(n) :
        if a[i] != 0 :
            flag = 1
            break
    if flag == 0 :
        break
    b = [0 for i in range(n)]
    for i in range(n) :
        b[i] = a[i]
        a[i] = a[i] // 2
    for i in range(m) :
        a[v[i]] += b[u[i]]
    ans = ans + 1

print(ans)

詳細信息

Test #1:

score: 100
Accepted
time: 7ms
memory: 9068kb

input:

3 2
1 1 1
1 2
2 3

output:

3

result:

ok 1 number(s): "3"

Test #2:

score: -100
Wrong Answer
time: 15ms
memory: 9100kb

input:

6 8
1 1 4 5 1 4
1 4
1 5
2 3
2 5
3 4
4 5
4 6
5 6

output:

12

result:

wrong answer 1st numbers differ - expected: '8', found: '12'