Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
5059 莫业祁 校门外的树 C++ Accepted 0 MS 296 KB 575 2024-11-01 22:55:41

Tests(10/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int m,l,qy[105][2],zs,ml[10005]; int main(){ cin>>l>>m; for(int i=0;i<m;i++){ cin>>qy[i][0]>>qy[i][1]; } for(int i=0;i<m;i++){ for(int j=qy[i][0];j<=qy[i][1];j++){ ml[j]=1; } } for(int i=0;i<=l;i++){ if(ml[i]==0)zs+=1; } cout<<zs; return 0; }