80332024-01-12 11:00:03Leventusz09Hús sütés (75 pont)csharpRuntime error 0/7532ms25620 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
base0/75
1Runtime error0/032ms20876 KiB
2Runtime error0/029ms21472 KiB
3Runtime error0/030ms21712 KiB
4Runtime error0/329ms22064 KiB
5Runtime error0/328ms22268 KiB
6Runtime error0/328ms22712 KiB
7Runtime error0/329ms22492 KiB
8Runtime error0/429ms23008 KiB
9Runtime error0/429ms23308 KiB
10Runtime error0/429ms23000 KiB
11Runtime error0/430ms23476 KiB
12Runtime error0/429ms23548 KiB
13Runtime error0/430ms23716 KiB
14Runtime error0/429ms23996 KiB
15Runtime error0/530ms24136 KiB
16Runtime error0/529ms24072 KiB
17Runtime error0/529ms24348 KiB
18Runtime error0/429ms24700 KiB
19Runtime error0/429ms24912 KiB
20Runtime error0/432ms25252 KiB
21Runtime error0/429ms25288 KiB
22Runtime error0/228ms25200 KiB
23Runtime error0/228ms25620 KiB