2515 | 2023-01-15 12:19:02 | kristof | Videójáték | python3 | Wrong answer 0/100 | 861ms | 93824 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]):
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 | 17ms | 11844 KiB | ||||
2 | Accepted | 17ms | 12264 KiB | ||||
subtask2 | 0/10 | ||||||
3 | Accepted | 16ms | 12464 KiB | ||||
4 | Accepted | 17ms | 12684 KiB | ||||
5 | Accepted | 17ms | 12780 KiB | ||||
6 | Accepted | 17ms | 13108 KiB | ||||
7 | Wrong answer | 17ms | 13116 KiB | ||||
8 | Wrong answer | 17ms | 13188 KiB | ||||
9 | Accepted | 17ms | 12968 KiB | ||||
10 | Wrong answer | 17ms | 13292 KiB | ||||
11 | Wrong answer | 17ms | 13320 KiB | ||||
subtask3 | 0/20 | ||||||
12 | Accepted | 17ms | 13552 KiB | ||||
13 | Wrong answer | 17ms | 13604 KiB | ||||
14 | Wrong answer | 17ms | 14148 KiB | ||||
15 | Accepted | 17ms | 14208 KiB | ||||
16 | Accepted | 18ms | 14384 KiB | ||||
17 | Wrong answer | 20ms | 14612 KiB | ||||
18 | Wrong answer | 21ms | 14884 KiB | ||||
19 | Accepted | 25ms | 15136 KiB | ||||
20 | Wrong answer | 23ms | 15172 KiB | ||||
21 | Wrong answer | 24ms | 15272 KiB | ||||
22 | Wrong answer | 18ms | 14744 KiB | ||||
subtask4 | 0/30 | ||||||
23 | Accepted | 97ms | 22176 KiB | ||||
24 | Accepted | 293ms | 41956 KiB | ||||
25 | Accepted | 748ms | 84924 KiB | ||||
26 | Accepted | 851ms | 93560 KiB | ||||
27 | Accepted | 845ms | 93328 KiB | ||||
28 | Accepted | 333ms | 46252 KiB | ||||
29 | Wrong answer | 67ms | 19864 KiB | ||||
30 | Wrong answer | 64ms | 19972 KiB | ||||
31 | Accepted | 43ms | 17500 KiB | ||||
subtask5 | 0/40 | ||||||
32 | Wrong answer | 94ms | 22716 KiB | ||||
33 | Wrong answer | 321ms | 44568 KiB | ||||
34 | Accepted | 559ms | 67292 KiB | ||||
35 | Accepted | 736ms | 84272 KiB | ||||
36 | Accepted | 855ms | 93768 KiB | ||||
37 | Accepted | 861ms | 93824 KiB | ||||
38 | Wrong answer | 485ms | 65368 KiB | ||||
39 | Wrong answer | 616ms | 75012 KiB | ||||
40 | Accepted | 157ms | 30168 KiB | ||||
41 | Wrong answer | 224ms | 38132 KiB |