79792024-01-12 09:38:00Leventusz09Programtermék verseny (70 pont)csharpAccepted 70/7094ms47516 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Programtermék{
    class Program{
        static void Main(){
            string[] in1 = Console.ReadLine().Split();
            int N = int.Parse(in1[0]), K = int.Parse(in1[1]) - 1;
            int[] P = Console.ReadLine().Split().Select(int.Parse).ToArray();

            int g = 0;
            int o1 = 0,o2 = 0,o3 = 0;

            for(int i=0; i<N; i++){
                if (P[i] > P[K]) g++;

                if (i >= K){
                    if (g < N / 12) o1 = i+1;
                    else if (g < N / 4) o2 = i+1;
                    else if (g < N / 2) o3 = i+1;
                }
            }
            Console.WriteLine(o1 + "\n" + o2 + "\n" + o3);
            Console.ReadKey();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base70/70
1Accepted0/030ms22372 KiB
2Accepted0/032ms22888 KiB
3Accepted0/090ms41176 KiB
4Accepted3/330ms24696 KiB
5Accepted3/329ms24616 KiB
6Accepted3/329ms24568 KiB
7Accepted3/332ms24236 KiB
8Accepted3/330ms24696 KiB
9Accepted3/330ms25092 KiB
10Accepted3/337ms25740 KiB
11Accepted3/337ms26380 KiB
12Accepted3/337ms26300 KiB
13Accepted3/337ms26864 KiB
14Accepted4/437ms26556 KiB
15Accepted4/463ms34476 KiB
16Accepted4/471ms37476 KiB
17Accepted4/475ms39756 KiB
18Accepted4/445ms29796 KiB
19Accepted4/448ms32276 KiB
20Accepted4/452ms33608 KiB
21Accepted4/494ms47020 KiB
22Accepted4/493ms47516 KiB
23Accepted4/487ms46408 KiB