80242024-01-12 10:38:21Leventusz09Áruszállítás (75 pont)csharpTime limit exceeded 63/75381ms41948 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Áruszállítás{
    class Program{
        static void Main(){
            string[] in1 = Console.ReadLine().Split();
            int N = int.Parse(in1[0]);
            int M = int.Parse(in1[1]);
            /*int[] F = new int[M];
            int[] T = new int[M];*/
            if (N == 1){Console.WriteLine(0);return;}
            int[] R = new int[N-1];

            int[] temp;
            for(int i=0, j; i<M; i++){
                temp = Console.ReadLine().Split().Select(int.Parse).ToArray();
                /*F[i] = temp[0];
                T[i] = temp[1];*/
                for(j=temp[0]; j < temp[1]; j++){
                    R[j-1]++;
                }
            }
            int o1 = 0;
            foreach(int i in R){
                if (i == 0) o1++;
            }
            Console.WriteLine(o1);
            
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base63/75
1Accepted0/030ms22328 KiB
2Accepted0/0225ms38312 KiB
3Accepted3/332ms23144 KiB
4Accepted3/332ms23464 KiB
5Accepted3/332ms23840 KiB
6Accepted3/332ms24144 KiB
7Accepted3/332ms23860 KiB
8Accepted4/432ms24184 KiB
9Accepted4/432ms24360 KiB
10Accepted4/432ms24576 KiB
11Accepted4/432ms24480 KiB
12Accepted4/434ms25260 KiB
13Accepted4/443ms28260 KiB
14Accepted4/448ms29660 KiB
15Accepted4/443ms28384 KiB
16Time limit exceeded0/4377ms9624 KiB
17Time limit exceeded0/4381ms10216 KiB
18Time limit exceeded0/4377ms10860 KiB
19Accepted4/450ms32272 KiB
20Accepted4/452ms34256 KiB
21Accepted4/4210ms41948 KiB
22Accepted4/4216ms41932 KiB