112892024-08-03 23:38:28probaElőzésekpython3Runtime error 0/10079ms26364 KiB
# előzések
sor1 = list(map(int, input().split(' '))); N = sor1[0]; elozes = sor1[1]

C = list(map(int, input().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 f:
    pos = C.index(i); kit = C[pos-1]
    #print(kit, end=' ')
    #print(C, f[i], kit, n.index(m)+1)
    C[pos-1], C[pos] = C[pos], C[pos-1]
    n[kit-1] += 1; m = max(n)
    print(n.index(m)+1)
    
#print(C)    
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms3044 KiB
subtask20/30
2Runtime error17ms3044 KiB
3Runtime error17ms2980 KiB
4Runtime error17ms3172 KiB
5Runtime error17ms3120 KiB
6Runtime error18ms3176 KiB
7Runtime error17ms3320 KiB
subtask30/70
8Runtime error28ms6740 KiB
9Runtime error35ms11076 KiB
10Runtime error43ms12480 KiB
11Runtime error50ms17864 KiB
12Runtime error54ms19012 KiB
13Runtime error57ms20356 KiB
14Runtime error74ms24660 KiB
15Runtime error79ms26364 KiB
16Runtime error74ms26232 KiB
17Runtime error79ms26248 KiB
18Runtime error79ms26272 KiB
19Runtime error78ms26104 KiB
20Runtime error70ms24800 KiB
21Runtime error78ms26304 KiB