236942026-01-27 17:53:39VizsimiVasúti rendezéspython3Wrong answer 0/75596ms45192 KiB
N = int(input())
list = input().split()
side = []
last = 0

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

while True:
  print(last)
  print(list)
  print(side)
  print()
  if last + 1 in list:
    if list[0] == last + 1:
      last += 1
      del list[0]
    else:
      side.append(list[0])
      del list[0]
  elif side[0] == last + 1:
    last += 1
    del side[0]
  else:
    break
print(last)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer16ms3124 KiB
subtask20/6
2Runtime error17ms3116 KiB
3Runtime error17ms3124 KiB
4Runtime error17ms3176 KiB
5Runtime error16ms2948 KiB
6Runtime error17ms3048 KiB
7Wrong answer16ms3128 KiB
subtask30/21
8Runtime error16ms3132 KiB
9Wrong answer16ms3072 KiB
10Wrong answer16ms2988 KiB
11Wrong answer16ms3148 KiB
12Runtime error17ms3120 KiB
13Runtime error17ms3108 KiB
14Runtime error16ms3132 KiB
15Wrong answer16ms3116 KiB
16Wrong answer16ms3072 KiB
17Wrong answer16ms3136 KiB
18Wrong answer16ms3020 KiB
19Runtime error16ms3124 KiB
20Wrong answer17ms2948 KiB
21Wrong answer16ms3000 KiB
22Runtime error16ms3128 KiB
23Runtime error16ms2940 KiB
24Wrong answer17ms3128 KiB
25Wrong answer16ms3048 KiB
26Wrong answer17ms3132 KiB
27Wrong answer17ms3124 KiB
28Wrong answer16ms3076 KiB
subtask40/24
29Wrong answer23ms3380 KiB
30Wrong answer30ms3892 KiB
31Wrong answer30ms3896 KiB
32Wrong answer37ms4224 KiB
33Wrong answer39ms4148 KiB
34Wrong answer39ms4216 KiB
35Wrong answer39ms4404 KiB
36Wrong answer35ms4184 KiB
37Wrong answer28ms3848 KiB
38Wrong answer32ms3892 KiB
39Wrong answer39ms4280 KiB
40Wrong answer39ms4452 KiB
41Wrong answer43ms4432 KiB
42Wrong answer43ms4400 KiB
43Wrong answer45ms4480 KiB
44Wrong answer45ms4404 KiB
45Wrong answer46ms4464 KiB
46Wrong answer46ms4672 KiB
47Wrong answer48ms4592 KiB
48Wrong answer50ms4664 KiB
49Wrong answer52ms4660 KiB
50Wrong answer52ms4824 KiB
51Wrong answer50ms4900 KiB
52Runtime error52ms4808 KiB
subtask50/24
53Time limit exceeded583ms43236 KiB
54Time limit exceeded586ms44668 KiB
55Time limit exceeded584ms43068 KiB
56Time limit exceeded584ms43724 KiB
57Time limit exceeded593ms45188 KiB
58Time limit exceeded595ms43812 KiB
59Time limit exceeded596ms44556 KiB
60Time limit exceeded593ms44452 KiB
61Time limit exceeded588ms43968 KiB
62Time limit exceeded587ms45112 KiB
63Time limit exceeded588ms43892 KiB
64Time limit exceeded589ms45176 KiB
65Time limit exceeded588ms44540 KiB
66Time limit exceeded588ms44664 KiB
67Time limit exceeded587ms45068 KiB
68Time limit exceeded588ms45192 KiB
69Time limit exceeded572ms41812 KiB
70Time limit exceeded572ms41728 KiB
71Time limit exceeded573ms41728 KiB
72Time limit exceeded573ms42308 KiB
73Time limit exceeded580ms42632 KiB
74Time limit exceeded582ms42468 KiB
75Time limit exceeded583ms42416 KiB
76Time limit exceeded583ms43432 KiB