Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
44486 wanglisuyang [在线测评解答教程] 求和 C++ Runtime Error 0 MS 292 KB 316 2024-03-30 16:33:27

Tests(0/10):


#include <bits/stdc++.h> using namespace std; int vis[10000]; int l,m,ans; int main(){ cin>>l>>m; for(int i=0;i<m;i++){ int v,u; cin>>v>>u; for(int j=v;j<=u;j++){ vis[j]=1; } } for(int k=0;k<=l;k++){ if(vis[k]==0) ans++; } cout<<ans<<endl; return 0; }


Judgement Protocol: