7952022-01-16 11:51:26Halasz EszterÁruszállítás (75 pont)cpp11Accepted 75/75104ms22524 KiB
#include <iostream>
//#include <fstream>
#include <vector>
#include <algorithm>

#define ll long long

using namespace std;

//ifstream cin("aruszallitas.in");
//ofstream cout("aruszallitas.out");

vector<ll>x;

ll aa,bb,db,i,n,m,a,b;

int main()
{
    cin>>n>>m;
    x.resize(n+1);
    for(i=1;i<=m;++i)
    {
        cin>>a>>b;
        x[a]++;
        x[b]--;
    }
    for(i=1;i<=n;++i) x[i]+=x[i-1];

    for(i=1;i<=n;++i)
    {
        if(x[i]==0) db++;
    }
    cout<<db-1;


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/02ms1976 KiB
2Accepted0/089ms18952 KiB
3Accepted3/32ms3500 KiB
4Accepted3/32ms3496 KiB
5Accepted3/32ms3500 KiB
6Accepted3/31ms3508 KiB
7Accepted3/31ms3516 KiB
8Accepted4/41ms3516 KiB
9Accepted4/41ms3520 KiB
10Accepted4/41ms3532 KiB
11Accepted4/42ms4252 KiB
12Accepted4/42ms4776 KiB
13Accepted4/46ms4916 KiB
14Accepted4/48ms6552 KiB
15Accepted4/46ms6532 KiB
16Accepted4/48ms8416 KiB
17Accepted4/49ms10076 KiB
18Accepted4/412ms11748 KiB
19Accepted4/416ms10308 KiB
20Accepted4/418ms11992 KiB
21Accepted4/4104ms21276 KiB
22Accepted4/478ms22524 KiB