80分求救!为什么头两个点没跑过
查看原帖
80分求救!为什么头两个点没跑过
879604
fupincheng楼主2022/12/4 17:01
我用的是Python

代码如下:

l,m=map(int,input().split())
tr=[]
s=0
for h in range(l+1):
    tr.append(1)
for j in range(m):
    a,b=map(int,input().split())
    for i in range(a,b):
        tr[i]=0
for k in tr:
    s+=k
print(s)

为什么头两个点没跑过???

2022/12/4 17:01
加载中...