33502023-02-27 09:42:17EyusieÁruszállítás üres szakaszaicpp17Time limit exceeded 2/50384ms3272 KiB
#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int mx;
    int darab;
    cin >> mx >> darab;
    int* tomb1 = new int[darab];
    int* tomb2 = new int[darab];
    for(int i = 0; i < darab; i++)
    {
     cin >> tomb1[i] >> tomb2[i];
    }
    int dszam = 0;
    int boolhely = darab;
    for(int i = 1; i <= mx; i++)
    {
        boolhely = darab;
        for(int j = 0; j < darab; j++)
        {
            if(i >= tomb1[j] && i <= tomb2[j])
                {
                boolhely--;
                break;
                }
        }
        if(boolhely == darab)
        {
            dszam++;
        }
    }
    cout << dszam;
}
SubtaskSumTestVerdictTimeMemory
base2/50
1Accepted0/03ms1744 KiB
2Time limit exceeded0/0375ms1828 KiB
3Wrong answer0/23ms2272 KiB
4Accepted2/23ms2340 KiB
5Wrong answer0/23ms2740 KiB
6Wrong answer0/23ms2588 KiB
7Wrong answer0/23ms2584 KiB
8Wrong answer0/23ms2832 KiB
9Wrong answer0/23ms2928 KiB
10Wrong answer0/23ms3008 KiB
11Wrong answer0/27ms3072 KiB
12Wrong answer0/250ms3092 KiB
13Time limit exceeded0/3384ms3104 KiB
14Time limit exceeded0/3360ms3120 KiB
15Time limit exceeded0/3358ms3172 KiB
16Time limit exceeded0/3384ms3064 KiB
17Time limit exceeded0/3381ms3080 KiB
18Time limit exceeded0/3372ms3124 KiB
19Time limit exceeded0/3321ms3272 KiB
20Time limit exceeded0/3367ms3268 KiB
21Time limit exceeded0/3335ms3132 KiB
22Time limit exceeded0/3351ms3228 KiB