129262025-01-03 15:52:11herczegkatProgramtermék verseny (70 pont)python3Accepted 70/7094ms14752 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; A=0;E=0;B=0
for i in range(1,hanyadik):
    if pL[i]>P: helye+=1
    
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/016ms3324 KiB
2Accepted0/014ms3128 KiB
3Accepted0/094ms14564 KiB
4Accepted3/316ms3128 KiB
5Accepted3/316ms3020 KiB
6Accepted3/316ms3044 KiB
7Accepted3/316ms2980 KiB
8Accepted3/316ms3220 KiB
9Accepted3/316ms3072 KiB
10Accepted3/316ms3128 KiB
11Accepted3/317ms3308 KiB
12Accepted3/317ms3360 KiB
13Accepted3/317ms3476 KiB
14Accepted4/418ms3472 KiB
15Accepted4/450ms8928 KiB
16Accepted4/454ms9600 KiB
17Accepted4/461ms10576 KiB
18Accepted4/421ms4152 KiB
19Accepted4/429ms5428 KiB
20Accepted4/432ms6528 KiB
21Accepted4/485ms14752 KiB
22Accepted4/481ms14676 KiB
23Accepted4/479ms12844 KiB