80262024-01-12 10:43:38TortelliniJrÁruszállítás üres szakaszaicsharpWrong answer 2/50209ms42092 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 + 1];
            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
base2/50
1Accepted0/030ms22392 KiB
2Wrong answer0/0209ms38212 KiB
3Wrong answer0/232ms22952 KiB
4Accepted2/230ms23144 KiB
5Wrong answer0/230ms23680 KiB
6Wrong answer0/230ms23804 KiB
7Wrong answer0/230ms24144 KiB
8Wrong answer0/232ms24496 KiB
9Wrong answer0/230ms24836 KiB
10Wrong answer0/232ms24968 KiB
11Wrong answer0/232ms25180 KiB
12Wrong answer0/232ms25532 KiB
13Wrong answer0/341ms28460 KiB
14Wrong answer0/346ms30316 KiB
15Wrong answer0/341ms28868 KiB
16Wrong answer0/3170ms34180 KiB
17Wrong answer0/3168ms34276 KiB
18Wrong answer0/3199ms34496 KiB
19Wrong answer0/348ms33272 KiB
20Wrong answer0/350ms34628 KiB
21Wrong answer0/3192ms42092 KiB
22Wrong answer0/3204ms41932 KiB