69042023-12-19 16:03:59999Programtermék verseny (70 pont)cpp17Accepted 70/7039ms4572 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 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<n/12){
				ans1=i;
			}
			else if(elottelevok<n/4){
				ans2=i;
			}
			else if(elottelevok<n/2){
				ans3=i;
			}
		}
		i++;
	}
	cout<<ans1<<endl<<ans2<<endl<<ans3<<endl;
}
SubtaskSumTestVerdictTimeMemory
base70/70
1Accepted0/03ms2088 KiB
2Accepted0/03ms2232 KiB
3Accepted0/037ms3156 KiB
4Accepted3/33ms2532 KiB
5Accepted3/33ms2620 KiB
6Accepted3/33ms2528 KiB
7Accepted3/33ms2648 KiB
8Accepted3/33ms2904 KiB
9Accepted3/33ms3284 KiB
10Accepted3/33ms3580 KiB
11Accepted3/33ms3740 KiB
12Accepted3/33ms3496 KiB
13Accepted3/34ms3564 KiB
14Accepted4/44ms3584 KiB
15Accepted4/419ms3860 KiB
16Accepted4/424ms4024 KiB
17Accepted4/427ms4020 KiB
18Accepted4/46ms4084 KiB
19Accepted4/48ms3976 KiB
20Accepted4/413ms3912 KiB
21Accepted4/437ms4508 KiB
22Accepted4/439ms4572 KiB
23Accepted4/434ms4204 KiB