1 solutions
-
0
👍
#include <bits/stdc++.h> using namespace std; int main(){ int l, m, f[10010], ans = 0; cin >> l >> m; for (int i = 0; i <= l; i++) { f[i] = 1; } for (int i = 1; i <= m; i++) { int u, v; cin >> u >> v; for (int k = u; k <= v; k++) { f[k] = 0; } } for (int i = 0; i <= l; i++) { if (f[i] == 1) { ans++; } } cout << ans; return 0; }
- 1
Information
- ID
- 80
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 10
- Tags
- # Submissions
- 1
- Accepted
- 1
- Uploaded By