35612023-03-01 00:15:05herczegkatÁruszállítás (75 pont)python3Time limit exceeded 55/75372ms21348 KiB
from sys import stdin, stdout
aDB,vDB=[int(i) for i in input().split()]
szakasz=[0]*(aDB-1)
for i in range(vDB):
    be=stdin.readline().split()
    k,v= int(be[0]), int(be[1]) 
    for j in range (k-1, v-1):
        szakasz[j]=1
van=0
for i in range(aDB-1):
        van+=szakasz[i]
print(aDB-1-van)
SubtaskSumTestVerdictTimeMemory
base55/75
1Accepted0/018ms11168 KiB
2Time limit exceeded0/0352ms11916 KiB
3Accepted3/317ms11716 KiB
4Accepted3/317ms11428 KiB
5Accepted3/317ms11892 KiB
6Accepted3/317ms12080 KiB
7Accepted3/317ms12456 KiB
8Accepted4/417ms12544 KiB
9Accepted4/417ms12740 KiB
10Accepted4/417ms13116 KiB
11Accepted4/428ms14224 KiB
12Accepted4/435ms14660 KiB
13Accepted4/459ms14784 KiB
14Accepted4/475ms16312 KiB
15Accepted4/465ms16364 KiB
16Time limit exceeded0/4351ms8296 KiB
17Time limit exceeded0/4372ms9116 KiB
18Time limit exceeded0/4345ms10100 KiB
19Accepted4/4197ms19844 KiB
20Accepted4/4203ms21348 KiB
21Time limit exceeded0/4368ms14052 KiB
22Time limit exceeded0/4361ms14088 KiB