2500 | 2023-01-13 23:05:15 | kristof | Videójáték | python3 | Wrong answer 0/100 | 893ms | 93676 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 >= min(LEn[IndexEn][1], LBarat[IndexBarat][1]):
b = max(LEn[IndexEn][0], LBarat[IndexBarat][0])
j = min(LEn[IndexEn][1], LBarat[IndexBarat][1])
if j > b:
EgyuttJatszottEgysegek += j-b+1
elif j == b:
EgyuttJatszottEgysegek += 1
if LEn[IndexEn][1] < LBarat[IndexBarat][1]:
IndexEn += 1
else:
IndexBarat += 1
else:
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 | 12192 KiB | ||||
2 | Accepted | 17ms | 12288 KiB | ||||
subtask2 | 0/10 | ||||||
3 | Accepted | 17ms | 12444 KiB | ||||
4 | Accepted | 17ms | 12388 KiB | ||||
5 | Accepted | 17ms | 12628 KiB | ||||
6 | Accepted | 17ms | 13004 KiB | ||||
7 | Wrong answer | 17ms | 13036 KiB | ||||
8 | Wrong answer | 17ms | 13080 KiB | ||||
9 | Accepted | 17ms | 13276 KiB | ||||
10 | Wrong answer | 17ms | 13196 KiB | ||||
11 | Wrong answer | 17ms | 13264 KiB | ||||
subtask3 | 0/20 | ||||||
12 | Accepted | 17ms | 13548 KiB | ||||
13 | Wrong answer | 17ms | 13764 KiB | ||||
14 | Wrong answer | 17ms | 14052 KiB | ||||
15 | Accepted | 18ms | 14008 KiB | ||||
16 | Accepted | 19ms | 14224 KiB | ||||
17 | Wrong answer | 20ms | 14416 KiB | ||||
18 | Wrong answer | 21ms | 14420 KiB | ||||
19 | Accepted | 26ms | 14668 KiB | ||||
20 | Wrong answer | 24ms | 15056 KiB | ||||
21 | Wrong answer | 25ms | 15172 KiB | ||||
22 | Wrong answer | 18ms | 14492 KiB | ||||
subtask4 | 0/30 | ||||||
23 | Accepted | 98ms | 22052 KiB | ||||
24 | Accepted | 296ms | 41620 KiB | ||||
25 | Accepted | 732ms | 84972 KiB | ||||
26 | Accepted | 843ms | 93180 KiB | ||||
27 | Accepted | 875ms | 92948 KiB | ||||
28 | Accepted | 333ms | 45988 KiB | ||||
29 | Wrong answer | 64ms | 19852 KiB | ||||
30 | Wrong answer | 64ms | 19788 KiB | ||||
31 | Accepted | 45ms | 17888 KiB | ||||
subtask5 | 0/40 | ||||||
32 | Wrong answer | 93ms | 22792 KiB | ||||
33 | Wrong answer | 316ms | 44592 KiB | ||||
34 | Accepted | 555ms | 67272 KiB | ||||
35 | Accepted | 732ms | 84088 KiB | ||||
36 | Accepted | 870ms | 93424 KiB | ||||
37 | Accepted | 893ms | 93676 KiB | ||||
38 | Wrong answer | 477ms | 65308 KiB | ||||
39 | Wrong answer | 637ms | 75016 KiB | ||||
40 | Accepted | 156ms | 30240 KiB | ||||
41 | Wrong answer | 225ms | 38248 KiB |