QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#795696#9580. 插排串联Sai0511WA 14ms10576kbPython3502b2024-11-30 23:23:372024-11-30 23:23:37

Judging History

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

  • [2024-11-30 23:23:37]
  • 评测
  • 测评结果:WA
  • 用时:14ms
  • 内存:10576kb
  • [2024-11-30 23:23:37]
  • 提交

answer

import sys
input=lambda:sys.stdin.readline().rstrip()

n=int(input())
t=[]
now=[0]*n
point=[]
limit=[]

for _ in range(n):
    t.append([*map(int,input().split())])
t=sorted(t)
print(t)
for i in range(n-1,-1,-1):
    if now[i]!=0:
        now[t[i][0]]+=now[i]
        point.append(now[i])
        limit.append(t[i][1])
    else:
        now[t[i][0]]+=t[i][1]
limit.sort()
point.sort()
ans='YES'
for x in range(len(limit)):
    if limit[x]<point[x]:
        ans='NO'
print(ans)

詳細信息

Test #1:

score: 0
Wrong Answer
time: 14ms
memory: 10576kb

input:

5
0 500
1 700
1 400
2 100
2 200

output:

[[0, 500], [1, 400], [1, 700], [2, 100], [2, 200]]
YES

result:

wrong answer 1st lines differ - expected: 'YES', found: '[[0, 500], [1, 400], [1, 700], [2, 100], [2, 200]]'