37642023-03-02 21:00:59DohajovDanielÁruszállítás (75 pont)python3Runtime error 24/7576ms44740 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
    kics[be[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
base24/75
1Accepted0/017ms11160 KiB
2Runtime error0/076ms42660 KiB
3Accepted3/317ms11588 KiB
4Runtime error0/317ms11920 KiB
5Accepted3/317ms12340 KiB
6Accepted3/317ms12168 KiB
7Accepted3/317ms12408 KiB
8Accepted4/417ms12652 KiB
9Runtime error0/417ms12576 KiB
10Runtime error0/417ms12632 KiB
11Accepted4/448ms14600 KiB
12Accepted4/465ms15528 KiB
13Runtime error0/420ms15736 KiB
14Runtime error0/425ms18620 KiB
15Runtime error0/424ms18712 KiB
16Runtime error0/435ms22352 KiB
17Runtime error0/437ms25336 KiB
18Runtime error0/439ms28824 KiB
19Runtime error0/429ms25640 KiB
20Runtime error0/432ms28828 KiB
21Runtime error0/472ms44552 KiB
22Runtime error0/454ms44740 KiB