Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
71721 sh25_ganzy 校门外的树 C++ 解答错误 0 MS 240 KB 488 2025-10-27 21:11:00

Tests(0/1):


#include<bits/stdc++.h> using namespace std; int main(){ int l,m,cnt=0; cin>>l>>m; bool remove=false; int start[m],end[m]; for(int i=0;i<m;i++){ cin>>start[i]>>end[i]; } for(int i=0;i<=l;i++){ for(int j=0;j<m;j++){ if(i>=start[j]&&i<=end[j]){ remove=true; } } if(remove==true){ cnt++; } remove=false; } cout<<cnt; return 0; }


测评信息: