2738 | 2023-01-19 21:59:55 | kristof | Videójáték | python3 | Runtime error 0/100 | 17ms | 14124 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 | 11072 KiB | ||||
2 | Runtime error | 16ms | 11272 KiB | ||||
subtask2 | 0/10 | ||||||
3 | Runtime error | 16ms | 11280 KiB | ||||
4 | Runtime error | 16ms | 11640 KiB | ||||
5 | Runtime error | 16ms | 11688 KiB | ||||
6 | Runtime error | 16ms | 11696 KiB | ||||
7 | Runtime error | 17ms | 12000 KiB | ||||
8 | Runtime error | 17ms | 11836 KiB | ||||
9 | Runtime error | 16ms | 11924 KiB | ||||
10 | Runtime error | 16ms | 12044 KiB | ||||
11 | Runtime error | 17ms | 12412 KiB | ||||
subtask3 | 0/20 | ||||||
12 | Runtime error | 17ms | 12676 KiB | ||||
13 | Runtime error | 17ms | 12584 KiB | ||||
14 | Runtime error | 17ms | 12688 KiB | ||||
15 | Runtime error | 17ms | 12868 KiB | ||||
16 | Runtime error | 17ms | 12820 KiB | ||||
17 | Runtime error | 17ms | 12740 KiB | ||||
18 | Runtime error | 17ms | 12944 KiB | ||||
19 | Runtime error | 17ms | 13224 KiB | ||||
20 | Runtime error | 17ms | 12876 KiB | ||||
21 | Runtime error | 16ms | 12936 KiB | ||||
22 | Runtime error | 17ms | 13268 KiB | ||||
subtask4 | 0/30 | ||||||
23 | Runtime error | 17ms | 13140 KiB | ||||
24 | Runtime error | 16ms | 13156 KiB | ||||
25 | Runtime error | 17ms | 13320 KiB | ||||
26 | Runtime error | 17ms | 13572 KiB | ||||
27 | Runtime error | 17ms | 13800 KiB | ||||
28 | Runtime error | 17ms | 13616 KiB | ||||
29 | Runtime error | 17ms | 13656 KiB | ||||
30 | Runtime error | 17ms | 13780 KiB | ||||
31 | Runtime error | 17ms | 14032 KiB | ||||
subtask5 | 0/40 | ||||||
32 | Runtime error | 17ms | 13984 KiB | ||||
33 | Runtime error | 17ms | 13968 KiB | ||||
34 | Runtime error | 17ms | 13968 KiB | ||||
35 | Runtime error | 16ms | 13988 KiB | ||||
36 | Runtime error | 16ms | 14072 KiB | ||||
37 | Runtime error | 16ms | 14076 KiB | ||||
38 | Runtime error | 17ms | 14104 KiB | ||||
39 | Runtime error | 17ms | 13684 KiB | ||||
40 | Runtime error | 17ms | 14016 KiB | ||||
41 | Runtime error | 17ms | 14124 KiB |