75032024-01-09 11:41:30TortelliniJrSípálya (55 pont)csharpWrong answer 0/55503ms31684 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Keses
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] inp1 = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int[] inp2 = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int loc;
            int locmax;
            int min = int.MaxValue;
            for (int i = inp1[1] - 1; i < inp1[0]; i++)
            {
                locmax = 0;
                loc = 0;
                for (int u = 0; u > -inp1[1]; u--)
                {
                    locmax = Math.Max(locmax, inp2[u + i] + u);
                    Console.WriteLine("f" + locmax);
                }
                for (int u = 0; u > -inp1[1]; u--)
                {
                    loc += inp2[u + i] - (locmax - u);
                    Console.WriteLine("g" + loc);
                }
                if (-loc < min)
                {
                    min = -loc;
                }
            }
            Console.WriteLine(min);
            Console.ReadLine();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base0/55
1Wrong answer0/030ms22256 KiB
2Wrong answer0/032ms22740 KiB
3Wrong answer0/264ms26104 KiB
4Wrong answer0/285ms28504 KiB
5Time limit exceeded0/2453ms10640 KiB
6Time limit exceeded0/2451ms11156 KiB
7Time limit exceeded0/3458ms11088 KiB
8Time limit exceeded0/1474ms12112 KiB
9Time limit exceeded0/1456ms12308 KiB
10Time limit exceeded0/1483ms12328 KiB
11Time limit exceeded0/1503ms12580 KiB
12Time limit exceeded0/1488ms12948 KiB
13Time limit exceeded0/1470ms13316 KiB
14Time limit exceeded0/2479ms13780 KiB
15Time limit exceeded0/2483ms13712 KiB
16Time limit exceeded0/2465ms30364 KiB
17Time limit exceeded0/2456ms30300 KiB
18Time limit exceeded0/2483ms30500 KiB
19Time limit exceeded0/3476ms30892 KiB
20Time limit exceeded0/2485ms30692 KiB
21Time limit exceeded0/2481ms30584 KiB
22Time limit exceeded0/2483ms30800 KiB
23Time limit exceeded0/2458ms30888 KiB
24Time limit exceeded0/2486ms31684 KiB
25Time limit exceeded0/2474ms31072 KiB
26Time limit exceeded0/2469ms31252 KiB
27Time limit exceeded0/2488ms31232 KiB
28Time limit exceeded0/3485ms31276 KiB
29Time limit exceeded0/3469ms30936 KiB
30Time limit exceeded0/3485ms31056 KiB