Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
147425 Kevin 校门外的树 C++ Accepted 1 MS 300 KB 279 2026-02-05 10:11:46

Tests(10/10):


Code:

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