129442025-01-03 17:15:05herczegkatProgramtermék verseny (70 pont)python3Accepted 70/7089ms14820 KiB
'''
12 3
1 2 20 5 21 22 26 27 23 28 24 25
12 4
1 2 5 21 20 22 26 27 23 28 24 25
12 3
1 2 20 5 21 22 26 27 23 28 24 25
12 12
12 11 10 9 8 7 6 5 4 3 2 1

'''
vDB,hanyadik =[int (i) for i in input().split()]
pL=[int (i) for i in input().split()]
pL=[0]+pL
uA=int(vDB/12); uE=int(vDB/4); uB=int(vDB/2)
#print(uA,uE,uB)
P=pL[hanyadik]
helye=1
for i in range(1,hanyadik):
    if pL[i]>P: helye+=1

A=0;E=0;B=0    
for i in range(hanyadik,vDB+1):
    if pL[i]>P: helye+=1
    if helye<=uA: A=i
    elif helye<=uE: E=i
    elif helye<=uB: B=i
print(A); print(E); print(B)


SubtaskSumTestVerdictTimeMemory
base70/70
1Accepted0/016ms3124 KiB
2Accepted0/016ms3132 KiB
3Accepted0/089ms14692 KiB
4Accepted3/316ms3128 KiB
5Accepted3/316ms3136 KiB
6Accepted3/316ms3312 KiB
7Accepted3/316ms3016 KiB
8Accepted3/316ms2936 KiB
9Accepted3/316ms2960 KiB
10Accepted3/317ms3092 KiB
11Accepted3/316ms3128 KiB
12Accepted3/317ms3236 KiB
13Accepted3/317ms3508 KiB
14Accepted4/417ms3368 KiB
15Accepted4/450ms8932 KiB
16Accepted4/456ms9596 KiB
17Accepted4/464ms10656 KiB
18Accepted4/420ms4092 KiB
19Accepted4/429ms5324 KiB
20Accepted4/432ms6528 KiB
21Accepted4/482ms14820 KiB
22Accepted4/486ms14728 KiB
23Accepted4/475ms12836 KiB