555,寄了,还是不刑
查看原帖
555,寄了,还是不刑
828705
blue_239k楼主2022/10/23 15:38
#include <iostream>
using namespace std;
int main(){
    int long long l;
    int m;
    cin>>l>>m;
    int u[m-1],v[m-1];
    for(int k=0;k<=m-1;k++){
        cin>>u[k]>>v[k];
    }
    int p[l-1];
    for(int long long k=0;k<=l-1;k++){
        for(int y=0;y<=m-1;y++){
            if(k>=u[y]&&k<=v[y]){
                if(y==m-1){
                    p[k]=1;
                }
                else{
                    continue;
                }
            }
            else{
                p[k]=0;
            }
        }
    }
    int long long out=0;
    for(int long long k=0;k<=l-1;k++){
        if(p[k]!=1){
            out=out+1;
        }
    }
    cout<<out;
    return 0;
}
2022/10/23 15:38
加载中...