2984 | 2023-02-07 09:33:16 | lacito | Videójáték | pypy3 | Time limit exceeded 0/100 | 2.079s | 200892 KiB |
from sys import stdin, stdout
def main():
global hanop
hanop = int(0)
t = int(stdin.readline())
n = int(stdin.readline())
te_szuneted=[]
hano_szunete=[]
for i in range(0,n):
te_szuneted.append(stdin.readline().split())
m = int(stdin.readline())
for j in range(m):
hano_szunete.append(stdin.readline().split())
#print(te_szuneted)
#print(hano_szunete)
opercek:int = 0
tszam:int = 0
te_szuneted = [[int(j) for j in i] for i in te_szuneted]
hano_szunete = [[int(j) for j in i] for i in hano_szunete]
#print(te_szuneted)
#print(hano_szunete)
def online(ido:int, hano_szunete_p) -> bool:
global hanop
try:
while hano_szunete_p[hanop][1] < ido:
hanop+=1
if hanop>=len(hano_szunete_p):
return False
except Exception:return False
if hano_szunete_p[hanop][0] <= ido:
return True
else:
#print(f"false, ido: {ido} ")
return False
for i in te_szuneted:
for j in range(i[0],i[1]+1):
#print("ido: "+str(j))
tszam+=1
if online(j,hano_szunete):
tszam = 0
#print(f"i: {i} j: {j}")
opercek+=1
if tszam==t:
break
tszam=0
stdout.write(str(int(opercek)))
return 0
main()
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 48ms | 76732 KiB | ||||
2 | Accepted | 54ms | 85772 KiB | ||||
subtask2 | 0/10 | ||||||
3 | Accepted | 45ms | 77884 KiB | ||||
4 | Accepted | 54ms | 86268 KiB | ||||
5 | Accepted | 43ms | 77780 KiB | ||||
6 | Accepted | 56ms | 87168 KiB | ||||
7 | Accepted | 54ms | 87212 KiB | ||||
8 | Accepted | 57ms | 86828 KiB | ||||
9 | Accepted | 43ms | 78208 KiB | ||||
10 | Accepted | 54ms | 87328 KiB | ||||
11 | Time limit exceeded | 2.079s | 25704 KiB | ||||
subtask3 | 0/20 | ||||||
12 | Accepted | 48ms | 78912 KiB | ||||
13 | Accepted | 57ms | 88136 KiB | ||||
14 | Accepted | 990ms | 88260 KiB | ||||
15 | Accepted | 59ms | 88508 KiB | ||||
16 | Accepted | 59ms | 88780 KiB | ||||
17 | Accepted | 275ms | 89908 KiB | ||||
18 | Time limit exceeded | 2.078s | 27484 KiB | ||||
19 | Time limit exceeded | 2.055s | 27908 KiB | ||||
20 | Wrong answer | 64ms | 89876 KiB | ||||
21 | Wrong answer | 71ms | 91080 KiB | ||||
22 | Wrong answer | 57ms | 83676 KiB | ||||
subtask4 | 0/30 | ||||||
23 | Accepted | 112ms | 103052 KiB | ||||
24 | Accepted | 160ms | 129136 KiB | ||||
25 | Accepted | 282ms | 185444 KiB | ||||
26 | Accepted | 287ms | 200828 KiB | ||||
27 | Accepted | 319ms | 200892 KiB | ||||
28 | Accepted | 180ms | 136656 KiB | ||||
29 | Wrong answer | 119ms | 99044 KiB | ||||
30 | Wrong answer | 105ms | 99328 KiB | ||||
31 | Accepted | 90ms | 95792 KiB | ||||
subtask5 | 0/40 | ||||||
32 | Wrong answer | 115ms | 104100 KiB | ||||
33 | Accepted | 257ms | 132852 KiB | ||||
34 | Accepted | 1.172s | 171832 KiB | ||||
35 | Time limit exceeded | 2.075s | 79300 KiB | ||||
36 | Time limit exceeded | 2.051s | 85300 KiB | ||||
37 | Time limit exceeded | 2.028s | 85804 KiB | ||||
38 | Wrong answer | 203ms | 165300 KiB | ||||
39 | Wrong answer | 228ms | 180480 KiB | ||||
40 | Accepted | 118ms | 112124 KiB | ||||
41 | Wrong answer | 136ms | 124120 KiB |