112872024-08-03 22:57:20probaElőzésekpython3Wrong answer 0/10079ms26400 KiB
# előzések
sor1 = list(map(int, input().split(' '))); N = sor1[0]; elozes = sor1[0]

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 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
1Wrong answer17ms3048 KiB
subtask20/30
2Runtime error17ms2960 KiB
3Runtime error17ms2980 KiB
4Runtime error17ms3088 KiB
5Runtime error17ms3172 KiB
6Runtime error17ms3172 KiB
7Runtime error17ms3300 KiB
subtask30/70
8Runtime error26ms6704 KiB
9Runtime error39ms10956 KiB
10Runtime error39ms12548 KiB
11Runtime error54ms18200 KiB
12Runtime error59ms18912 KiB
13Runtime error59ms20432 KiB
14Runtime error68ms24660 KiB
15Runtime error78ms26120 KiB
16Runtime error79ms26276 KiB
17Runtime error72ms26232 KiB
18Runtime error75ms26400 KiB
19Runtime error79ms26156 KiB
20Runtime error70ms24684 KiB
21Runtime error78ms26380 KiB