2516 | 2023-01-15 14:28:52 | kristof | Videójáték | python3 | Wrong answer 0/100 | 896ms | 93012 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:
if LEn[IndexEn][0] + MegunasiIdo + 1 <= min(LEn[IndexEn][1], LBarat[IndexBarat][1]):
if LEn[IndexEn][1] < LBarat[IndexBarat][1]:
IndexEn += 1
else:
IndexBarat += 1
else:
b = max(LEn[IndexEn][0], LBarat[IndexBarat][0])
j = min(LEn[IndexEn][1], LBarat[IndexBarat][1])
if j >= b:
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 | Accepted | 18ms | 11308 KiB | ||||
2 | Accepted | 17ms | 11796 KiB | ||||
subtask2 | 0/10 | ||||||
3 | Accepted | 17ms | 11892 KiB | ||||
4 | Accepted | 17ms | 12156 KiB | ||||
5 | Accepted | 17ms | 12284 KiB | ||||
6 | Accepted | 17ms | 12216 KiB | ||||
7 | Wrong answer | 17ms | 12600 KiB | ||||
8 | Wrong answer | 17ms | 12584 KiB | ||||
9 | Accepted | 17ms | 12600 KiB | ||||
10 | Wrong answer | 17ms | 12784 KiB | ||||
11 | Wrong answer | 17ms | 12904 KiB | ||||
subtask3 | 0/20 | ||||||
12 | Accepted | 17ms | 12804 KiB | ||||
13 | Wrong answer | 17ms | 12996 KiB | ||||
14 | Wrong answer | 17ms | 12756 KiB | ||||
15 | Accepted | 18ms | 13152 KiB | ||||
16 | Accepted | 19ms | 13464 KiB | ||||
17 | Wrong answer | 20ms | 13840 KiB | ||||
18 | Wrong answer | 21ms | 13904 KiB | ||||
19 | Accepted | 26ms | 14148 KiB | ||||
20 | Wrong answer | 23ms | 14380 KiB | ||||
21 | Wrong answer | 24ms | 14072 KiB | ||||
22 | Wrong answer | 18ms | 13980 KiB | ||||
subtask4 | 0/30 | ||||||
23 | Accepted | 96ms | 21288 KiB | ||||
24 | Accepted | 291ms | 41128 KiB | ||||
25 | Accepted | 757ms | 84196 KiB | ||||
26 | Accepted | 889ms | 92548 KiB | ||||
27 | Accepted | 847ms | 92612 KiB | ||||
28 | Accepted | 344ms | 45488 KiB | ||||
29 | Wrong answer | 67ms | 19388 KiB | ||||
30 | Wrong answer | 64ms | 19144 KiB | ||||
31 | Accepted | 45ms | 17052 KiB | ||||
subtask5 | 0/40 | ||||||
32 | Wrong answer | 96ms | 21892 KiB | ||||
33 | Wrong answer | 316ms | 43684 KiB | ||||
34 | Accepted | 555ms | 66704 KiB | ||||
35 | Accepted | 734ms | 83648 KiB | ||||
36 | Accepted | 883ms | 92888 KiB | ||||
37 | Accepted | 896ms | 93012 KiB | ||||
38 | Wrong answer | 485ms | 64732 KiB | ||||
39 | Wrong answer | 635ms | 74292 KiB | ||||
40 | Accepted | 158ms | 29412 KiB | ||||
41 | Wrong answer | 224ms | 37968 KiB |