127812024-12-30 14:17:21KissCsongor777Áruszállítás üres szakaszaicpp17Wrong answer 0/50400ms6204 KiB
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n,m,x,y,db=0;
    cin>>n>>m;
    vector<int>v(n,1);
    for(int i=1; i<=m; i++)
    {
        cin>>x>>y;
        fill(v.begin()+x-1,v.begin()+y-1,0);
    }
    vector<int>::iterator it;
    for(it=v.begin();it!=v.end();it++)cout<<*it<<" ";
    cout<<endl;
    if(v[0]==1)db++;
    if(v[n-1]==v[n-2]+1)db--;
    for(int i=0; i<n-1; i++)
        if(v[i+1]==v[i]+1)db++;
    cout<<db;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/01ms320 KiB
2Wrong answer0/0111ms6200 KiB
3Wrong answer0/21ms320 KiB
4Wrong answer0/21ms508 KiB
5Wrong answer0/21ms320 KiB
6Wrong answer0/21ms352 KiB
7Wrong answer0/21ms320 KiB
8Wrong answer0/21ms320 KiB
9Wrong answer0/21ms320 KiB
10Wrong answer0/21ms372 KiB
11Wrong answer0/24ms568 KiB
12Wrong answer0/28ms1020 KiB
13Wrong answer0/39ms804 KiB
14Wrong answer0/317ms1336 KiB
15Wrong answer0/316ms1336 KiB
16Time limit exceeded0/3400ms4152 KiB
17Time limit exceeded0/3386ms4152 KiB
18Time limit exceeded0/3388ms4152 KiB
19Wrong answer0/334ms2628 KiB
20Wrong answer0/341ms3384 KiB
21Wrong answer0/3103ms6144 KiB
22Wrong answer0/3104ms6204 KiB