QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#770937#7953. Product DeliveryvwxyzCompile Error//C++23256b2024-11-22 03:43:112024-11-22 03:43:11

Judging History

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

  • [2024-11-22 03:43:11]
  • 评测
  • [2024-11-22 03:43:11]
  • 提交

answer

N=int(input())
L,R=[],[]
for i in range(N):
    l,r=map(int,input().split())
    L.append(l)
    R.append(r)
ans=0
cur=-1
for l,r in zip(L[::-1],R[::-1]):
    if l<=cur:
        cur=min(cur,r)
    else:
        ans+=1
        cur=r
print(ans)

详细

answer.code:1:1: error: ‘N’ does not name a type
    1 | N=int(input())
      | ^