| Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 73162 | sh25_wangsj | 校门外的树 | C++ | 通过 | 0 MS | 252 KB | 545 | 2025-11-07 14:24:34 |
#include <iostream> #include <cstring> using namespace std; int main() { int L, M; cin >> L >> M; bool tree[666]; for(int e=0;e<=L;e++){ tree[e]=true; } for(int i=0; i < M; ++i) { int a, b; cin >> a >> b; for (int j = a; j <= b; j++) { tree[j] = false; } } int count = 0; for (int i = 0; i <= L; ++i) { if (tree[i]) count++; } cout << count << endl; return 0; }