77052024-01-10 14:05:27TortelliniJrFasor (40)csharpRuntime error 20/40178ms76072 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace racshalo
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] inp = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int fsz = inp[0];
            int max = inp[1];
            int[] fakbeta = Console.ReadLine().Split().Select(int.Parse).ToArray();   // '29
            GC.Collect(0);
            int[] fak = new int[fsz + 2 * max];
            fakbeta.CopyTo(fak, max);
            int u = -1;
            for (int i = max; i < fsz + max; i++)
            {
                if (fak.ToList().GetRange(i - max, 2 * max + 1).Max() <= fak[i])
                {
                    u = i + 1 - max;
                    break;
                }
            }
            Console.WriteLine(u);
            Console.ReadLine();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base20/40
1Accepted0/034ms21912 KiB
2Accepted0/050ms37360 KiB
3Accepted2/234ms23180 KiB
4Accepted2/234ms23396 KiB
5Accepted2/232ms23328 KiB
6Accepted2/232ms23736 KiB
7Accepted2/239ms25132 KiB
8Accepted2/243ms31516 KiB
9Accepted2/243ms26432 KiB
10Accepted2/252ms39060 KiB
11Accepted2/264ms58032 KiB
12Accepted2/245ms27584 KiB
13Runtime error0/2144ms76072 KiB
14Runtime error0/2153ms75764 KiB
15Runtime error0/2168ms75724 KiB
16Runtime error0/2173ms75544 KiB
17Runtime error0/2178ms75492 KiB
18Runtime error0/2168ms75240 KiB
19Runtime error0/2173ms75072 KiB
20Runtime error0/2135ms74712 KiB
21Runtime error0/2158ms74176 KiB
22Runtime error0/2166ms74176 KiB