Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
106832 6张轶涵 校门外的树 C++ Wrong Answer 1 MS 312 KB 352 2025-01-16 17:00:17

Tests(8/10):


Code:

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


Run Info:

------Input------
1000 5 0 100 101 200 900 1000 207 400 401 899
------Answer-----
6
------Your output-----
7