为什么全紫,pycham上做对了

P1047 [NOIP2005 普及组] 校门外的树

linyiyi123456 @ 2023-02-19 20:17:56

num = int(input('请输入马路长度:'))
shu = int(input('请输入区域数目:'))
ls1 = []
for i in range(num + 1):
    ls1.append(1)
for i in range(shu):
    begin: int = int(input('请输入起始点'))
    over = int(input('请输入终止点:'))
    for j in range(begin, (over + 1)):
        ls1[j] = 0
chang = 0
for i in range(len(ls1)):
    chang += ls1[i]
print(chang)

by Chtholly_is_cute @ 2023-05-23 08:13:17

《请输入》


上一页 |