78572024-01-11 13:36:05ananászLegmesszebbi rossz sorrendű (35 pont)csharpTime limit exceeded 5/35280ms40680 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace leghosszabb_rossz
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int[] szamok = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int veg = N-1;
            int kezd = 0;
            while (szamok[0]<=szamok[veg])
            {
                veg--;
            }
            for (int i = 1; i < N; i++)
            {
                int akt = N-1;
                while (szamok[i] <= szamok[akt] && akt - i > veg - kezd)
                {
                    akt--;
                }
                if (akt - i > veg - kezd)
                {
                    kezd = i;
                    veg = akt;
                }
            }
            Console.WriteLine($"{kezd+1} {veg+1}");
            Console.ReadKey();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base5/35
1Accepted0/032ms22316 KiB
2Time limit exceeded0/0261ms13840 KiB
3Runtime error0/132ms22788 KiB
4Accepted1/129ms23992 KiB
5Runtime error0/134ms23064 KiB
6Runtime error0/132ms23488 KiB
7Accepted1/130ms24996 KiB
8Accepted1/137ms25340 KiB
9Accepted1/146ms26080 KiB
10Accepted1/152ms26400 KiB
11Runtime error0/137ms25200 KiB
12Time limit exceeded0/2280ms11116 KiB
13Time limit exceeded0/2244ms11368 KiB
14Time limit exceeded0/2272ms11496 KiB
15Time limit exceeded0/2239ms9876 KiB
16Time limit exceeded0/2280ms11548 KiB
17Time limit exceeded0/2264ms13948 KiB
18Time limit exceeded0/2256ms14996 KiB
19Time limit exceeded0/2256ms15372 KiB
20Time limit exceeded0/2280ms15656 KiB
21Time limit exceeded0/2273ms16720 KiB
22Time limit exceeded0/2273ms16616 KiB
23Runtime error0/290ms40248 KiB
24Runtime error0/286ms40680 KiB