2734 | 2023-01-19 21:43:33 | kristof | Videójáték | python3 | Wrong answer 40/100 | 819ms | 93128 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 | 11260 KiB | ||||
2 | Accepted | 17ms | 11564 KiB | ||||
subtask2 | 10/10 | ||||||
3 | Accepted | 17ms | 11680 KiB | ||||
4 | Accepted | 17ms | 11796 KiB | ||||
5 | Accepted | 17ms | 12128 KiB | ||||
6 | Accepted | 17ms | 12472 KiB | ||||
7 | Accepted | 17ms | 12352 KiB | ||||
8 | Accepted | 17ms | 12908 KiB | ||||
9 | Accepted | 17ms | 12772 KiB | ||||
10 | Accepted | 17ms | 13008 KiB | ||||
11 | Accepted | 17ms | 13240 KiB | ||||
subtask3 | 0/20 | ||||||
12 | Accepted | 17ms | 13476 KiB | ||||
13 | Accepted | 17ms | 13692 KiB | ||||
14 | Accepted | 17ms | 13984 KiB | ||||
15 | Accepted | 17ms | 14156 KiB | ||||
16 | Accepted | 18ms | 13856 KiB | ||||
17 | Accepted | 20ms | 14120 KiB | ||||
18 | Wrong answer | 21ms | 14392 KiB | ||||
19 | Accepted | 25ms | 14568 KiB | ||||
20 | Accepted | 23ms | 14984 KiB | ||||
21 | Accepted | 23ms | 14800 KiB | ||||
22 | Accepted | 18ms | 14332 KiB | ||||
subtask4 | 30/30 | ||||||
23 | Accepted | 87ms | 21652 KiB | ||||
24 | Accepted | 266ms | 41404 KiB | ||||
25 | Accepted | 671ms | 84436 KiB | ||||
26 | Accepted | 819ms | 92964 KiB | ||||
27 | Accepted | 808ms | 92572 KiB | ||||
28 | Accepted | 312ms | 45660 KiB | ||||
29 | Accepted | 64ms | 19792 KiB | ||||
30 | Accepted | 63ms | 19344 KiB | ||||
31 | Accepted | 41ms | 16964 KiB | ||||
subtask5 | 0/40 | ||||||
32 | Wrong answer | 86ms | 22164 KiB | ||||
33 | Wrong answer | 277ms | 43876 KiB | ||||
34 | Accepted | 521ms | 66556 KiB | ||||
35 | Accepted | 657ms | 83620 KiB | ||||
36 | Accepted | 774ms | 93128 KiB | ||||
37 | Accepted | 796ms | 93036 KiB | ||||
38 | Accepted | 472ms | 64916 KiB | ||||
39 | Accepted | 572ms | 74404 KiB | ||||
40 | Accepted | 145ms | 29296 KiB | ||||
41 | Accepted | 222ms | 37128 KiB |