46202023-03-30 12:23:34Leventusz19Leghosszabb béke (75 pont)csharpWrong answer 38/75300ms29212 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++) {
                    if(!D[j]) D[j] = true;
                }
            }
            int o = 0;
            int[] om = {0, 0};
            for(int i=0;i<I[0];i++){
                if (!D[i]) o++; else o = 0;
                if (o > om[0]){om[0]=o;om[1] = i; }
            }
            Console.WriteLine((om[0]) + " " + (om[1] + 2 - om[0]));
            Console.ReadKey();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base38/75
1Wrong answer0/032ms21896 KiB
2Time limit exceeded0/0300ms9244 KiB
3Wrong answer0/332ms22508 KiB
4Wrong answer0/330ms23268 KiB
5Accepted3/330ms23288 KiB
6Wrong answer0/330ms23308 KiB
7Accepted3/330ms23764 KiB
8Accepted4/429ms24452 KiB
9Accepted4/429ms24172 KiB
10Accepted4/432ms24684 KiB
11Accepted4/457ms27392 KiB
12Accepted4/486ms28780 KiB
13Accepted4/464ms27376 KiB
14Accepted4/471ms28104 KiB
15Accepted4/486ms29212 KiB
16Time limit exceeded0/4280ms9324 KiB
17Time limit exceeded0/4237ms8940 KiB
18Time limit exceeded0/4270ms8972 KiB
19Time limit exceeded0/4261ms10104 KiB
20Time limit exceeded0/4261ms8600 KiB
21Time limit exceeded0/4277ms8544 KiB
22Time limit exceeded0/4222ms8696 KiB