Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
73161 sh25_wangsj 校门外的树 C++ 解答错误 0 MS 252 KB 545 2025-11-07 14:23:55

Tests(0/1):


#include <iostream> #include <cstring> using namespace std; int main() { int L, M; cin >> L >> M; bool tree[666]; for(int e=1;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; }


测评信息: