2740 | 2023-01-19 23:00:02 | kristof | Videójáték | python3 | Runtime error 0/100 | 18ms | 14524 KiB |
import sys
sys.stderr.write("exited")
exit(-1)
#* Az az idő amely alatt megunom a játékot egyedül
MegunasiIdo = int(input())
#* Szüneteimnek száma, szüneteim range formában, listában
NEn = int(input())
LEn = []
for i in range(NEn):
rawInput = list(map(int, input().split()))
LEn.append(rawInput)
#* Barát szüneteinek száma, szünetei range formában, listában
NBarat = int(input())
LBarat = []
for i in range(NBarat):
rawInput = list(map(int, input().split()))
LBarat.append(rawInput)
#* Melyik indexnél tartok a listában (külön En, Barat)
IndexEn = IndexBarat = 0
#* Mostani unatkozas
UnatkozasMost = 0
#* Bal Ă©s jobb oldal a rangenek
b: int = 0
j: int = 0
EgyuttJatszottEgysegek = 0
while IndexEn < NEn and IndexBarat < NBarat:
b = max(LEn[IndexEn][0], LBarat[IndexBarat][0])
j = min(LEn[IndexEn][1], LBarat[IndexBarat][1])
if j >= b and LEn[IndexEn][0] + MegunasiIdo >= LBarat[IndexBarat][0]:
EgyuttJatszottEgysegek += j-b+1
LEn[IndexEn][0] = j
if LEn[IndexEn][1] < LBarat[IndexBarat][1]:
IndexEn += 1
else:
IndexBarat += 1
print(EgyuttJatszottEgysegek)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Runtime error | 18ms | 11240 KiB | ||||
2 | Runtime error | 17ms | 11644 KiB | ||||
subtask2 | 0/10 | ||||||
3 | Runtime error | 17ms | 11692 KiB | ||||
4 | Runtime error | 17ms | 11608 KiB | ||||
5 | Runtime error | 17ms | 11952 KiB | ||||
6 | Runtime error | 17ms | 12184 KiB | ||||
7 | Runtime error | 17ms | 12348 KiB | ||||
8 | Runtime error | 17ms | 12676 KiB | ||||
9 | Runtime error | 17ms | 12972 KiB | ||||
10 | Runtime error | 17ms | 12792 KiB | ||||
11 | Runtime error | 17ms | 13056 KiB | ||||
subtask3 | 0/20 | ||||||
12 | Runtime error | 17ms | 13208 KiB | ||||
13 | Runtime error | 17ms | 13176 KiB | ||||
14 | Runtime error | 17ms | 13188 KiB | ||||
15 | Runtime error | 17ms | 13404 KiB | ||||
16 | Runtime error | 16ms | 13252 KiB | ||||
17 | Runtime error | 16ms | 13516 KiB | ||||
18 | Runtime error | 16ms | 13408 KiB | ||||
19 | Runtime error | 16ms | 13304 KiB | ||||
20 | Runtime error | 17ms | 13316 KiB | ||||
21 | Runtime error | 17ms | 13744 KiB | ||||
22 | Runtime error | 17ms | 13892 KiB | ||||
subtask4 | 0/30 | ||||||
23 | Runtime error | 17ms | 13824 KiB | ||||
24 | Runtime error | 17ms | 14064 KiB | ||||
25 | Runtime error | 17ms | 13964 KiB | ||||
26 | Runtime error | 17ms | 14068 KiB | ||||
27 | Runtime error | 17ms | 14008 KiB | ||||
28 | Runtime error | 17ms | 14004 KiB | ||||
29 | Runtime error | 17ms | 13916 KiB | ||||
30 | Runtime error | 16ms | 14372 KiB | ||||
31 | Runtime error | 17ms | 14264 KiB | ||||
subtask5 | 0/40 | ||||||
32 | Runtime error | 17ms | 14156 KiB | ||||
33 | Runtime error | 17ms | 13952 KiB | ||||
34 | Runtime error | 17ms | 14252 KiB | ||||
35 | Runtime error | 17ms | 14332 KiB | ||||
36 | Runtime error | 17ms | 14224 KiB | ||||
37 | Runtime error | 17ms | 14416 KiB | ||||
38 | Runtime error | 17ms | 14212 KiB | ||||
39 | Runtime error | 17ms | 14256 KiB | ||||
40 | Runtime error | 17ms | 14176 KiB | ||||
41 | Runtime error | 17ms | 14524 KiB |