这篇代码输出结果总是少一个 都来帮我看看【大哭】

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

Xurey @ 2024-06-28 19:56:45

l,m = input().split() l,m = int(l),int(m) s = [0] t = [0] s += [0]m t += [0]m l = [0] num = 0 for b in range(1,m+1): s[b],t[b] = input().split() s[b],t[b] = int(s[b]),int(t[b]) for a in range(0,l-1): l += [0] for b in range(1,3): for a in range(s[b],t[b]+1): l[a] = 1 for a in range(0,l): if l[a] == 0: num += 1 print(num)

这篇代码输出结果总是少一个 都来帮我看看【大哭】


by King_and_Grey @ 2024-06-28 20:11:51

@Xurey + 1


by King_and_Grey @ 2024-06-28 20:12:36

@Xurey 代码能整理一下吗?(我看不懂)


by Grammar__hbw @ 2024-06-28 20:13:03

希丰展?使Md


by Grammar__hbw @ 2024-06-28 20:15:32

而且如果这是python代码的话,一定会Sorry: IndentationError: unexpected indent (src, line 1)或者SyntaxError: invalid syntax的呢~


|