Re: ID: 8007

Posted by BeeSuonCha at 2022-09-27 16:46:46
#include<bits/stdc++.h>
using namespace std;
int L,N,P,K;
int i,t,temp;
int a[1001];
main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //freopen("OREHNJACA.INP","r",stdin);
    //freopen("OREHNJACA.OUT","w",stdout);
    cin>>L;
    cin>>N;
    i=1;
    while(i<=N)
    {
        cin>>P>>K;
        for(t=P; t<=K; t=t+1)
        {
            if(a[t]!=0) t++;
            else a[t]=i;
        }
        i++;
    }

}

Hiện tại đã code đến đây
Followed by

Reply