77862024-01-11 10:05:09NotYouFasor (40)csharpWrong answer 0/40156ms61724 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace fasor1
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] s = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int n = s[0]; 
            int k = s[1]; 
            int[] magas = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int jf = magas[0];
            int ind = 1; 
            for (int i = 0; i < n-k; i++)
            {
                if (jf<magas[i])
                {
                    jf = magas[i];
                    ind = i;
                }
            }
            if (ind == 1)
            {
                ind = -1;
            }
            Console.WriteLine(ind);
            Console.ReadLine();
        }
    }
}
 
SubtaskSumTestVerdictTimeMemory
base0/40
1Wrong answer0/032ms22048 KiB
2Wrong answer0/039ms24656 KiB
3Wrong answer0/229ms22952 KiB
4Wrong answer0/229ms22984 KiB
5Wrong answer0/229ms23048 KiB
6Wrong answer0/229ms23156 KiB
7Wrong answer0/235ms23508 KiB
8Wrong answer0/235ms24316 KiB
9Wrong answer0/239ms25932 KiB
10Wrong answer0/241ms26624 KiB
11Wrong answer0/241ms26832 KiB
12Wrong answer0/239ms26940 KiB
13Wrong answer0/293ms42792 KiB
14Wrong answer0/289ms40924 KiB
15Wrong answer0/2143ms57604 KiB
16Wrong answer0/2144ms59600 KiB
17Wrong answer0/2156ms61636 KiB
18Wrong answer0/2155ms61476 KiB
19Wrong answer0/2149ms61724 KiB
20Wrong answer0/278ms38676 KiB
21Wrong answer0/2144ms58476 KiB
22Wrong answer0/2153ms61484 KiB