112862024-08-03 22:56:38probaElőzésekpython3Runtime error 0/10029ms5536 KiB
# előzések
sor1 = list(map(int, input().split(' '))); N = sor1[0]; elozes = sor1[0]

C = list(map(int, '5 2 3 4 1 7 6'.split(' ')))

f = []
for i in range(elozes):
    f += [int(input())]

#f = list(map(int, '1 1 1 4 3 7 4 6'.split(' ')))

n = [0]*N

for i in range(elozes):
    ki = C.index(f[i]); kit = C[ki-1]; 
    #print(C, f[i], kit, n.index(m)+1)
    C[ki-1], C[ki] = C[ki], C[ki-1]
    n[kit-1] += 1; m = max(n)
    print(n.index(m)+1)
    
#print(C)    
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Runtime error17ms3044 KiB
subtask20/30
2Runtime error18ms3224 KiB
3Runtime error17ms2952 KiB
4Runtime error17ms3096 KiB
5Runtime error17ms3044 KiB
6Runtime error17ms3044 KiB
7Runtime error17ms3192 KiB
subtask30/70
8Runtime error19ms3424 KiB
9Runtime error21ms4196 KiB
10Runtime error20ms3976 KiB
11Runtime error24ms4600 KiB
12Runtime error26ms5348 KiB
13Runtime error26ms4836 KiB
14Runtime error27ms5188 KiB
15Runtime error28ms5492 KiB
16Runtime error29ms5536 KiB
17Runtime error29ms5428 KiB
18Runtime error28ms5444 KiB
19Runtime error28ms5440 KiB
20Runtime error28ms5348 KiB
21Runtime error27ms5516 KiB