1 条题解
-
0
C++ :
#include <bits/stdc++.h> using namespace std; int main(){ int l, m; cin >> l >> m; int trees[10005] = {0}; for(int i = 0; i < m; ++i){ int s,e; cin >> s >> e; for(int j = s; j <= e; ++j){ trees[j] = 1; } } int ans = 0; for(int i = 0; i <= l; ++i){ if(trees[i] == 0){ ans++; } } cout << ans << endl; return 0; }
- 1
信息
- ID
- 67
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者