69022023-12-19 15:50:05999Programtermék verseny (70 pont)cpp17Wrong answer 54/7039ms4524 KiB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
using namespace std;

int main() {
	int n,k;cin>>n>>k;
	vector<int> v(n+1);
	for(int i = 1;i<=n;i++){
		cin>>v[i];
	}
	int arany=n/12,ezust=n/4,bronz=n/2,elottelevok=0;
	int i=1,ans1=0,ans2=0,ans3=0;
	while(i<=n){
		if(v[i]>v[k]){
			elottelevok++;
		}
		if(i>=k){
			if(elottelevok<arany){
				ans1=i;
			}
			if(elottelevok<ezust){
				ans2=i;
			}
			if(elottelevok<bronz){
				ans3=i;
			}
		}
		i++;
	}
	cout<<ans1<<endl<<ans2<<endl<<ans3<<endl;
}
SubtaskSumTestVerdictTimeMemory
base54/70
1Accepted0/03ms1812 KiB
2Wrong answer0/03ms2052 KiB
3Accepted0/039ms2972 KiB
4Wrong answer0/33ms2444 KiB
5Wrong answer0/33ms2672 KiB
6Wrong answer0/33ms2756 KiB
7Accepted3/33ms2880 KiB
8Accepted3/33ms2968 KiB
9Wrong answer0/33ms3040 KiB
10Accepted3/33ms3172 KiB
11Accepted3/33ms3432 KiB
12Accepted3/33ms3456 KiB
13Accepted3/33ms3332 KiB
14Accepted4/44ms3436 KiB
15Accepted4/419ms3504 KiB
16Accepted4/423ms3636 KiB
17Accepted4/427ms3880 KiB
18Accepted4/46ms3572 KiB
19Accepted4/48ms3604 KiB
20Wrong answer0/412ms3692 KiB
21Accepted4/437ms4412 KiB
22Accepted4/437ms4524 KiB
23Accepted4/432ms4356 KiB