237252026-01-28 12:12:23VizsimiVasúti rendezéspython3Wrong answer 0/75601ms10776 KiB
N = int(input())
list = input().split()
side = []
last = 0

for i in range(N):
  list[i] = int(list[i])

while True:
    if last + 1 in list:
        if list[0] == last + 1:
            last += 1
            del list[0]
        else:
            for i in range(list.index(last + 1)):
                side.append(list[0])
                del list[0]
            last += 1
    if side[0] == last + 1:
        last += 1
        del side[0]
    else:
        break
print(last)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer14ms3124 KiB
subtask20/6
2Runtime error17ms3320 KiB
3Runtime error16ms3120 KiB
4Accepted16ms3124 KiB
5Runtime error16ms3124 KiB
6Wrong answer16ms3096 KiB
7Accepted16ms3112 KiB
subtask30/21
8Wrong answer16ms3112 KiB
9Wrong answer14ms3096 KiB
10Runtime error16ms3120 KiB
11Wrong answer14ms3104 KiB
12Wrong answer17ms3124 KiB
13Runtime error17ms3312 KiB
14Wrong answer17ms3300 KiB
15Wrong answer16ms3096 KiB
16Runtime error16ms3064 KiB
17Runtime error16ms3064 KiB
18Wrong answer16ms3072 KiB
19Wrong answer16ms2948 KiB
20Runtime error17ms3320 KiB
21Wrong answer16ms3312 KiB
22Wrong answer16ms3124 KiB
23Wrong answer17ms3124 KiB
24Wrong answer16ms3076 KiB
25Wrong answer16ms3048 KiB
26Accepted16ms3084 KiB
27Accepted14ms3124 KiB
28Accepted16ms3028 KiB
subtask40/24
29Runtime error16ms3324 KiB
30Runtime error16ms3096 KiB
31Wrong answer16ms3124 KiB
32Wrong answer16ms3124 KiB
33Runtime error17ms3076 KiB
34Runtime error16ms3124 KiB
35Runtime error17ms2948 KiB
36Wrong answer16ms2936 KiB
37Wrong answer17ms3024 KiB
38Wrong answer16ms3004 KiB
39Wrong answer16ms2924 KiB
40Wrong answer16ms3068 KiB
41Wrong answer16ms2996 KiB
42Wrong answer16ms2996 KiB
43Wrong answer16ms3136 KiB
44Runtime error16ms3124 KiB
45Wrong answer17ms3148 KiB
46Wrong answer17ms3124 KiB
47Wrong answer17ms3124 KiB
48Wrong answer16ms3124 KiB
49Wrong answer17ms3028 KiB
50Wrong answer16ms3004 KiB
51Wrong answer16ms3132 KiB
52Wrong answer16ms2956 KiB
subtask50/24
53Wrong answer63ms10544 KiB
54Wrong answer61ms10548 KiB
55Wrong answer63ms10552 KiB
56Runtime error63ms10552 KiB
57Wrong answer65ms10536 KiB
58Wrong answer63ms10776 KiB
59Runtime error61ms10696 KiB
60Wrong answer61ms10552 KiB
61Wrong answer65ms10552 KiB
62Wrong answer59ms10552 KiB
63Runtime error61ms10676 KiB
64Runtime error57ms10552 KiB
65Runtime error61ms10552 KiB
66Wrong answer61ms10552 KiB
67Wrong answer70ms10572 KiB
68Wrong answer64ms10556 KiB
69Time limit exceeded587ms10724 KiB
70Time limit exceeded587ms10648 KiB
71Time limit exceeded601ms10552 KiB
72Time limit exceeded601ms10576 KiB
73Time limit exceeded592ms10736 KiB
74Time limit exceeded593ms10548 KiB
75Time limit exceeded601ms10552 KiB
76Time limit exceeded601ms10660 KiB