35622023-03-01 00:18:56herczegkatÁruszállítás (75 pont)python3Time limit exceeded 55/75388ms21008 KiB
from sys import stdin, stdout
def main():
    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)
main()
SubtaskSumTestVerdictTimeMemory
base55/75
1Accepted0/017ms11188 KiB
2Time limit exceeded0/0368ms11728 KiB
3Accepted3/317ms11696 KiB
4Accepted3/317ms11812 KiB
5Accepted3/317ms12064 KiB
6Accepted3/317ms12272 KiB
7Accepted3/317ms12676 KiB
8Accepted4/417ms12276 KiB
9Accepted4/417ms12444 KiB
10Accepted4/417ms12700 KiB
11Accepted4/423ms13624 KiB
12Accepted4/428ms14160 KiB
13Accepted4/441ms14204 KiB
14Accepted4/452ms15964 KiB
15Accepted4/446ms15624 KiB
16Time limit exceeded0/4388ms8176 KiB
17Time limit exceeded0/4381ms8940 KiB
18Time limit exceeded0/4354ms9848 KiB
19Accepted4/4115ms19500 KiB
20Accepted4/4123ms21008 KiB
21Time limit exceeded0/4324ms13972 KiB
22Time limit exceeded0/4358ms13952 KiB