80252024-01-12 10:40:14TortelliniJrÁruszállítás üres szakaszaicsharpRuntime error 0/50168ms39648 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Szinezes
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] inp = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int all = inp[0];
            int arusz = inp[1];
            int[] ball = new int[all];
            for (int i = 0; i < arusz; i++)
            {
                inp = Console.ReadLine().Split().Select(int.Parse).ToArray();
                ball[inp[0]]++;
                ball[inp[1]]--;
            }
            int sol = 0;
            int bal = 0;
            int el = 0;
            for (int i = 0; i < all; i++)
            {
                el = bal;
                bal += ball[i];
                if (bal == 0 && el != 0)
                {
                    sol++;
                }
            }
            Console.WriteLine(sol);
            Console.ReadLine();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/030ms22216 KiB
2Runtime error0/071ms39076 KiB
3Wrong answer0/232ms22604 KiB
4Runtime error0/232ms22292 KiB
5Wrong answer0/230ms23324 KiB
6Wrong answer0/232ms24004 KiB
7Wrong answer0/230ms23992 KiB
8Wrong answer0/230ms24512 KiB
9Runtime error0/234ms23852 KiB
10Runtime error0/234ms23612 KiB
11Wrong answer0/232ms24988 KiB
12Wrong answer0/232ms25488 KiB
13Runtime error0/334ms25060 KiB
14Runtime error0/335ms26228 KiB
15Runtime error0/335ms26300 KiB
16Runtime error0/3151ms33824 KiB
17Runtime error0/3168ms33780 KiB
18Runtime error0/3166ms34380 KiB
19Runtime error0/335ms27556 KiB
20Runtime error0/335ms28392 KiB
21Runtime error0/359ms39648 KiB
22Runtime error0/343ms35148 KiB