1 条题解

  • 1
    @ 2025-1-16 18:12:43
    #include<iostream>
    using namespace std;
    int b[10005];
    int main(){
    	int l,m,x[103],y[103],e=0;
    	cin>>l>>m;
    	for(int i=1;i<=m;i++){
    		cin>>x[i]>>y[i];
    		for(int j=x[i];j<=y[i];j++){
    			b[j]=1;
    		}
    	}
    	for(int t=0;t<=l;t++){
    		if(b[t]==0){
    		e++;	
    		}
    	}
    	cout<<e;
    }
    
    • 1

    信息

    ID
    30
    时间
    1000ms
    内存
    125MiB
    难度
    4
    标签
    递交数
    1
    已通过
    1
    上传者