2737 | 2023-01-19 21:59:07 | kristof | Videójáték | python3 | Runtime error 0/100 | 17ms | 14240 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
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 | 17ms | 11012 KiB | ||||
2 | Runtime error | 16ms | 11140 KiB | ||||
subtask2 | 0/10 | ||||||
3 | Runtime error | 17ms | 11660 KiB | ||||
4 | Runtime error | 17ms | 11948 KiB | ||||
5 | Runtime error | 17ms | 12068 KiB | ||||
6 | Runtime error | 17ms | 12100 KiB | ||||
7 | Runtime error | 17ms | 12348 KiB | ||||
8 | Runtime error | 16ms | 12432 KiB | ||||
9 | Runtime error | 17ms | 12616 KiB | ||||
10 | Runtime error | 17ms | 12912 KiB | ||||
11 | Runtime error | 17ms | 13040 KiB | ||||
subtask3 | 0/20 | ||||||
12 | Runtime error | 17ms | 13332 KiB | ||||
13 | Runtime error | 17ms | 13244 KiB | ||||
14 | Runtime error | 17ms | 13152 KiB | ||||
15 | Runtime error | 17ms | 13272 KiB | ||||
16 | Runtime error | 16ms | 13140 KiB | ||||
17 | Runtime error | 16ms | 13324 KiB | ||||
18 | Runtime error | 17ms | 13428 KiB | ||||
19 | Runtime error | 17ms | 13368 KiB | ||||
20 | Runtime error | 16ms | 13776 KiB | ||||
21 | Runtime error | 16ms | 13636 KiB | ||||
22 | Runtime error | 16ms | 13504 KiB | ||||
subtask4 | 0/30 | ||||||
23 | Runtime error | 17ms | 13380 KiB | ||||
24 | Runtime error | 17ms | 13300 KiB | ||||
25 | Runtime error | 17ms | 13484 KiB | ||||
26 | Runtime error | 17ms | 13248 KiB | ||||
27 | Runtime error | 17ms | 13580 KiB | ||||
28 | Runtime error | 17ms | 13456 KiB | ||||
29 | Runtime error | 17ms | 13920 KiB | ||||
30 | Runtime error | 17ms | 13864 KiB | ||||
31 | Runtime error | 17ms | 13956 KiB | ||||
subtask5 | 0/40 | ||||||
32 | Runtime error | 16ms | 13924 KiB | ||||
33 | Runtime error | 17ms | 14024 KiB | ||||
34 | Runtime error | 17ms | 13952 KiB | ||||
35 | Runtime error | 17ms | 13804 KiB | ||||
36 | Runtime error | 17ms | 13916 KiB | ||||
37 | Runtime error | 16ms | 13860 KiB | ||||
38 | Runtime error | 17ms | 13664 KiB | ||||
39 | Runtime error | 17ms | 13780 KiB | ||||
40 | Runtime error | 17ms | 14056 KiB | ||||
41 | Runtime error | 16ms | 14240 KiB |