2736 | 2023-01-19 21:45:20 | kristof | Videójáték | python3 | Wrong answer 40/100 | 794ms | 93116 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 | Accepted | 17ms | 11156 KiB | ||||
2 | Accepted | 17ms | 11556 KiB | ||||
subtask2 | 10/10 | ||||||
3 | Accepted | 17ms | 11720 KiB | ||||
4 | Accepted | 17ms | 11824 KiB | ||||
5 | Accepted | 17ms | 11872 KiB | ||||
6 | Accepted | 17ms | 11956 KiB | ||||
7 | Accepted | 17ms | 12240 KiB | ||||
8 | Accepted | 17ms | 12004 KiB | ||||
9 | Accepted | 17ms | 12324 KiB | ||||
10 | Accepted | 17ms | 12620 KiB | ||||
11 | Accepted | 17ms | 12436 KiB | ||||
subtask3 | 0/20 | ||||||
12 | Accepted | 17ms | 12600 KiB | ||||
13 | Accepted | 17ms | 12920 KiB | ||||
14 | Accepted | 17ms | 13208 KiB | ||||
15 | Accepted | 17ms | 13676 KiB | ||||
16 | Accepted | 18ms | 13744 KiB | ||||
17 | Accepted | 20ms | 13904 KiB | ||||
18 | Wrong answer | 20ms | 14036 KiB | ||||
19 | Accepted | 24ms | 14764 KiB | ||||
20 | Accepted | 21ms | 14452 KiB | ||||
21 | Accepted | 23ms | 14484 KiB | ||||
22 | Accepted | 18ms | 14512 KiB | ||||
subtask4 | 30/30 | ||||||
23 | Accepted | 89ms | 21428 KiB | ||||
24 | Accepted | 261ms | 41524 KiB | ||||
25 | Accepted | 675ms | 84280 KiB | ||||
26 | Accepted | 783ms | 92912 KiB | ||||
27 | Accepted | 783ms | 92724 KiB | ||||
28 | Accepted | 303ms | 45556 KiB | ||||
29 | Accepted | 64ms | 19456 KiB | ||||
30 | Accepted | 61ms | 19480 KiB | ||||
31 | Accepted | 41ms | 16780 KiB | ||||
subtask5 | 0/40 | ||||||
32 | Wrong answer | 87ms | 21900 KiB | ||||
33 | Wrong answer | 284ms | 43644 KiB | ||||
34 | Accepted | 500ms | 66432 KiB | ||||
35 | Accepted | 699ms | 83460 KiB | ||||
36 | Accepted | 759ms | 93004 KiB | ||||
37 | Accepted | 794ms | 93116 KiB | ||||
38 | Accepted | 467ms | 64724 KiB | ||||
39 | Accepted | 574ms | 74324 KiB | ||||
40 | Accepted | 143ms | 29416 KiB | ||||
41 | Accepted | 218ms | 38044 KiB |