Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
150532 马俊潇 校门外的树 C++ Accepted 2 MS 664 KB 270 2026-03-28 15:37:14

Tests(10/10):


Code:

#include<iostream> using namespace std; int main(){ int a[100000]={},l,m,s1=0; cin>>l>>m; for(int i=1;i<=m;i++){ int s,e; cin>>s>>e; for(int j=s;j<=e;j++){ if(a[j]==0){ s1+=1; a[j]=1;}}} cout<<l+1-s1; return 0; }