Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
119637 胡汪兵-小胡老师 校门外的树 C++ Accepted 1 MS 312 KB 284 2025-05-18 09:55:45

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int a[10001]={0}; int l,m,ks,js,count=0; cin>>l>>m; for(int i=0;i<m;i++) { cin>>ks>>js; for(int j=ks;j<=js;j++) a[j]=1; } for(int i=0;i<=l;i++) if(a[i]==0) count++; cout<<count; return 0; }