46192023-03-30 12:20:37Leventusz19Leghosszabb béke (75 pont)csharpTime limit exceeded 6/75273ms28680 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Leghoszabb_béke{
    class Program{
        static void Main(string[] args){
            int[] I = Console.ReadLine().Split().Select(int.Parse).ToArray();
            bool[] D = new bool[I[0]];
            for(int i=0;i<I[1]; i++){
                int[] in2 = Console.ReadLine().Split().Select(int.Parse).ToArray();
                for(int j=in2[0]; j<in2[1]; j++) {
                    D[j] = true;
                }
            }
            int o = 0;
            int[] om = {0, 0};

            for(int i=0;i<D.Length;i++){
                if (!D[i]) o++; else o = 0;
                if (o > om[0]){om[0]=o;om[1] = i; }
            }
            Console.WriteLine((om[0]-1) + " " + (om[1] + 2 - om[0]));
            Console.ReadKey();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base6/75
1Accepted0/032ms21776 KiB
2Time limit exceeded0/0224ms7736 KiB
3Wrong answer0/332ms22800 KiB
4Accepted3/330ms23200 KiB
5Wrong answer0/330ms22804 KiB
6Accepted3/330ms23224 KiB
7Wrong answer0/330ms23064 KiB
8Wrong answer0/430ms23180 KiB
9Wrong answer0/430ms23604 KiB
10Wrong answer0/432ms23876 KiB
11Wrong answer0/457ms26584 KiB
12Wrong answer0/486ms28196 KiB
13Wrong answer0/465ms27252 KiB
14Wrong answer0/471ms27728 KiB
15Wrong answer0/487ms28680 KiB
16Time limit exceeded0/4263ms8992 KiB
17Time limit exceeded0/4241ms8472 KiB
18Time limit exceeded0/4270ms8644 KiB
19Time limit exceeded0/4273ms9728 KiB
20Time limit exceeded0/4250ms8244 KiB
21Time limit exceeded0/4254ms8412 KiB
22Time limit exceeded0/4266ms8500 KiB