sor1 = list(map(int, input().split(' ')))
#sor1 = list(map(int, '7 8'.split(' ')))
seloz = [0]*sor1[0]
#cars = list(map(int, '5 2 3 4 1 7 6'.split(' ')))
cars = list(map(int, input().split(' ')))
for i in range(sor1[1]):
k = cars.index(int(input()))
seloz[cars[k-1]-1] +=1
cars[k], cars[k-1] = cars[k-1], cars[k]
print(seloz.index(max(seloz))+1)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 17ms | 2916 KiB | ||||
subtask2 | 0/30 | ||||||
2 | Runtime error | 18ms | 2824 KiB | ||||
3 | Runtime error | 17ms | 3088 KiB | ||||
4 | Runtime error | 17ms | 3120 KiB | ||||
5 | Runtime error | 18ms | 3172 KiB | ||||
6 | Runtime error | 18ms | 3320 KiB | ||||
7 | Runtime error | 17ms | 3324 KiB | ||||
subtask3 | 0/70 | ||||||
8 | Runtime error | 28ms | 7512 KiB | ||||
9 | Runtime error | 37ms | 12252 KiB | ||||
10 | Runtime error | 41ms | 13752 KiB | ||||
11 | Runtime error | 52ms | 18864 KiB | ||||
12 | Runtime error | 57ms | 21204 KiB | ||||
13 | Runtime error | 61ms | 22732 KiB | ||||
14 | Runtime error | 79ms | 27520 KiB | ||||
15 | Runtime error | 82ms | 29436 KiB | ||||
16 | Runtime error | 83ms | 29176 KiB | ||||
17 | Runtime error | 83ms | 29172 KiB | ||||
18 | Runtime error | 78ms | 29208 KiB | ||||
19 | Runtime error | 76ms | 29176 KiB | ||||
20 | Runtime error | 72ms | 27728 KiB | ||||
21 | Runtime error | 82ms | 29104 KiB |