Run ID:150532
提交时间:2026-03-28 15:37:14
#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; }