QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#765173#8057. Best Carry Player 4yangjlWA 8ms10520kbPython3431b2024-11-20 12:51:362024-11-20 12:51:41

Judging History

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

  • [2024-11-20 12:51:41]
  • 评测
  • 测评结果:WA
  • 用时:8ms
  • 内存:10520kb
  • [2024-11-20 12:51:36]
  • 提交

answer

t=int(input())

def ilist():
      return list(map(int,input().split()))

for line in range(t):
      m=int(input())
      a=ilist()
      b=ilist()
      ans=0
      for i in range(1,m):
          tmp=min(a[i],b[m-i])
          a[i]-=tmp
          b[m-i]-=tmp
          ans+=tmp
      if ans:
          ans+=a[m-1]+b[m-1]
          for i in range(m-1):
              ans+=min(a[i],b[m-1-i])    
      print(ans)

詳細信息

Test #1:

score: 0
Wrong Answer
time: 8ms
memory: 10520kb

input:

5
2
1 2
3 4
3
1 0 1
0 1 0
4
1 0 0 1
1 1 1 1
5
123456 114514 1919810 233333 234567
20050815 998244353 0 0 0
10
5 3 5 3 2 4 2 4 1 5
9 9 8 2 4 4 3 5 3 0

output:

5
1
3
467900
26

result:

wrong answer 3rd numbers differ - expected: '2', found: '3'