77082024-01-10 14:13:48TortelliniJrFasor (40)csharpTime limit exceeded 20/40289ms32408 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];
            int[] cop = new int[max * 2 + 1];
            fakbeta.CopyTo(fak, max);
            int u = -1;
            for (int i = max; i < fsz + max; i++)
            {
                Array.Copy(fak, i - max, cop, 0, max * 2 + 1);
                if (cop.Max() <= fak[i])
                {
                    u = i + 1 - max;
                    break;
                }
            }
            Console.WriteLine(u);
            Console.ReadLine();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base20/40
1Accepted0/032ms22236 KiB
2Accepted0/043ms25096 KiB
3Accepted2/232ms23052 KiB
4Accepted2/232ms23812 KiB
5Accepted2/232ms24168 KiB
6Accepted2/232ms24388 KiB
7Accepted2/239ms25372 KiB
8Accepted2/241ms25700 KiB
9Accepted2/243ms27520 KiB
10Accepted2/246ms27924 KiB
11Accepted2/246ms28168 KiB
12Accepted2/243ms28004 KiB
13Time limit exceeded0/2277ms22368 KiB
14Time limit exceeded0/2289ms21208 KiB
15Time limit exceeded0/2259ms28116 KiB
16Time limit exceeded0/2207ms29260 KiB
17Time limit exceeded0/2280ms31872 KiB
18Time limit exceeded0/2280ms31384 KiB
19Time limit exceeded0/2270ms31764 KiB
20Time limit exceeded0/2256ms19852 KiB
21Time limit exceeded0/2287ms29336 KiB
22Time limit exceeded0/2259ms32408 KiB