69002023-12-19 15:46:09999Programtermék verseny (70 pont)cpp17Wrong answer 51/7039ms9320 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(i==k){
			i++;
			continue;
		}
		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
base51/70
1Accepted0/03ms1996 KiB
2Wrong answer0/03ms2056 KiB
3Accepted0/039ms3772 KiB
4Wrong answer0/33ms3072 KiB
5Wrong answer0/33ms3352 KiB
6Wrong answer0/33ms3404 KiB
7Wrong answer0/33ms3644 KiB
8Accepted3/33ms3764 KiB
9Wrong answer0/33ms3880 KiB
10Accepted3/33ms4088 KiB
11Accepted3/33ms4224 KiB
12Accepted3/33ms4332 KiB
13Accepted3/34ms4436 KiB
14Accepted4/44ms4456 KiB
15Accepted4/419ms5048 KiB
16Accepted4/424ms5472 KiB
17Accepted4/428ms6104 KiB
18Accepted4/46ms5796 KiB
19Accepted4/48ms6176 KiB
20Wrong answer0/413ms6640 KiB
21Accepted4/439ms7824 KiB
22Accepted4/439ms8556 KiB
23Accepted4/434ms9320 KiB