Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
37320 zhouhuanyu 玙静 校门外的树 C++ 通过 1 MS 264 KB 331 2024-01-20 10:39:52

Tests(1/1):


#include <bits/stdc++.h> using namespace std; int a[10001]; int main(){ int l, m, cnt = 1; cin >> l >> m; while(m--){ int left, right; cin >> left >> right; for(int j = left; j <= right; j++){ a[j] = 1; } } for(int i = 0; i < l; i++){ if(a[i] == 0){ cnt++; } } cout << cnt; return 0; }


测评信息: