2735 | 2023-01-19 21:44:32 | kristof | Videójáték | python3 | Runtime error 0/100 | 18ms | 14224 KiB |
#* 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
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 | 11448 KiB | ||||
2 | Runtime error | 17ms | 11636 KiB | ||||
subtask2 | 0/10 | ||||||
3 | Runtime error | 17ms | 12052 KiB | ||||
4 | Runtime error | 17ms | 12232 KiB | ||||
5 | Runtime error | 17ms | 12548 KiB | ||||
6 | Runtime error | 17ms | 12564 KiB | ||||
7 | Runtime error | 17ms | 12588 KiB | ||||
8 | Runtime error | 17ms | 12940 KiB | ||||
9 | Runtime error | 17ms | 13304 KiB | ||||
10 | Runtime error | 17ms | 13388 KiB | ||||
11 | Runtime error | 17ms | 13164 KiB | ||||
subtask3 | 0/20 | ||||||
12 | Runtime error | 17ms | 12844 KiB | ||||
13 | Runtime error | 17ms | 13432 KiB | ||||
14 | Runtime error | 17ms | 13216 KiB | ||||
15 | Runtime error | 17ms | 13376 KiB | ||||
16 | Runtime error | 17ms | 13276 KiB | ||||
17 | Runtime error | 17ms | 13568 KiB | ||||
18 | Runtime error | 17ms | 13792 KiB | ||||
19 | Runtime error | 17ms | 13736 KiB | ||||
20 | Runtime error | 17ms | 13720 KiB | ||||
21 | Runtime error | 17ms | 13476 KiB | ||||
22 | Runtime error | 16ms | 13516 KiB | ||||
subtask4 | 0/30 | ||||||
23 | Runtime error | 17ms | 13716 KiB | ||||
24 | Runtime error | 17ms | 13612 KiB | ||||
25 | Runtime error | 17ms | 14224 KiB | ||||
26 | Runtime error | 17ms | 14048 KiB | ||||
27 | Runtime error | 17ms | 13972 KiB | ||||
28 | Runtime error | 17ms | 14032 KiB | ||||
29 | Runtime error | 17ms | 13968 KiB | ||||
30 | Runtime error | 17ms | 13992 KiB | ||||
31 | Runtime error | 17ms | 13928 KiB | ||||
subtask5 | 0/40 | ||||||
32 | Runtime error | 17ms | 14020 KiB | ||||
33 | Runtime error | 17ms | 14136 KiB | ||||
34 | Runtime error | 17ms | 14096 KiB | ||||
35 | Runtime error | 17ms | 14048 KiB | ||||
36 | Runtime error | 17ms | 14016 KiB | ||||
37 | Runtime error | 17ms | 14104 KiB | ||||
38 | Runtime error | 17ms | 13836 KiB | ||||
39 | Runtime error | 17ms | 13844 KiB | ||||
40 | Runtime error | 17ms | 14024 KiB | ||||
41 | Runtime error | 17ms | 14164 KiB |