77602024-01-11 08:39:12TortelliniJrFasor (40)csharpTime limit exceeded 20/40273ms27304 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[] fak = new int[fsz + 2 * max];
            int[] cop = new int[max * 2 + 1];
            Console.ReadLine().Split().Select(int.Parse).ToArray().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/032ms22580 KiB
2Accepted0/041ms24996 KiB
3Accepted2/230ms23352 KiB
4Accepted2/232ms23676 KiB
5Accepted2/232ms24144 KiB
6Accepted2/232ms24076 KiB
7Accepted2/237ms25112 KiB
8Accepted2/239ms25444 KiB
9Accepted2/241ms26544 KiB
10Accepted2/241ms26732 KiB
11Accepted2/243ms26988 KiB
12Accepted2/241ms26984 KiB
13Time limit exceeded0/2270ms16884 KiB
14Time limit exceeded0/2273ms17216 KiB
15Time limit exceeded0/2261ms25504 KiB
16Time limit exceeded0/2256ms26256 KiB
17Time limit exceeded0/2256ms27304 KiB
18Time limit exceeded0/2261ms26776 KiB
19Time limit exceeded0/2261ms26984 KiB
20Time limit exceeded0/2259ms15204 KiB
21Time limit exceeded0/2268ms25720 KiB
22Time limit exceeded0/2268ms26912 KiB