37652023-03-02 21:02:43DohajovDanielÁruszállítás (75 pont)python3Time limit exceeded 67/75400ms29392 KiB
allomdb,csbe=[int(i) for i in input().split()]
kics=[0]*allomdb
becs=[0]*allomdb
for i in range(csbe):
    be=[int(i) for i in input().split()]
    becs[be[0]-1]+=1
    kics[be[1]-1]+=1
csdb=0;uvon=0
for i in range(allomdb):
    csdb+=becs[i]
    csdb-=kics[i]
    if csdb==0 and i<allomdb-1:
        uvon+=1
print(uvon)
"""
10 4
8 9
1 6
1 3
3 4
"""
SubtaskSumTestVerdictTimeMemory
base67/75
1Accepted0/017ms11124 KiB
2Time limit exceeded0/0400ms19580 KiB
3Accepted3/317ms11264 KiB
4Accepted3/317ms11616 KiB
5Accepted3/317ms11944 KiB
6Accepted3/317ms12140 KiB
7Accepted3/317ms12240 KiB
8Accepted4/417ms12460 KiB
9Accepted4/417ms12848 KiB
10Accepted4/417ms12736 KiB
11Accepted4/446ms14492 KiB
12Accepted4/461ms15536 KiB
13Accepted4/463ms15588 KiB
14Accepted4/4109ms18496 KiB
15Accepted4/4112ms18704 KiB
16Accepted4/4150ms22492 KiB
17Accepted4/4187ms25788 KiB
18Accepted4/4228ms29232 KiB
19Accepted4/4185ms26320 KiB
20Accepted4/4210ms29392 KiB
21Time limit exceeded0/4368ms22200 KiB
22Time limit exceeded0/4354ms22072 KiB