Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
162587 郦辰希 校门外的树 C++ Accepted 1 MS 312 KB 380 2026-10-17 17:48:00

Tests(10/10):


Code:

#include <bits/stdc++.h> using namespace std; int main() { int i,j,n,L,M,m1,m2,a[10001]={}; cin>>L>>M; int l1=L; l1 +=1; for(i=0;i<M;i++){ cin>>m1>>m2; for(j=m1;j<=m2;j++){ a[j]=1; } } for(i=0;i<=L;i++){ if(a[i]==1){ l1-=1; } } cout<<l1; return 0; }