phoenixzhan @ 2023-08-20 13:15:26
#include <bits/stdc++.h>
using namespace std;
int l, m,b[10001];
signed main() {
cin>>l>>m;
for(int i=0;i<=l;i++)b[i]=1;//初始化
for(int i=1;i<=m;i++){
int u,v;
cin>>u>>v;//输入
for(int j=u;j<=v;j++)//for循环
if(b[j]!=0)b[j]=0;
}
int ans=0;
for(int i=0;i<=m;i++)
if(b[i])ans+=1;//ans=ans+1
printf("%d",ans);
return 0;
}
by xiazeyu123 @ 2023-08-20 13:21:23
for(int i=0;i<=l;i++)
by xiazeyu123 @ 2023-08-20 13:21:40
@_CCF
by phoenixzhan @ 2023-08-20 13:22:41
@xiazeyu123 哪一行啊?
by phoenixzhan @ 2023-08-20 13:23:30
@xiazeyu123 谢谢大佬,已经AC了
by xiazeyu123 @ 2023-08-20 13:24:05
@_CCF 倒数第5行
by phoenixzhan @ 2023-08-20 13:25:51
@xiazeyu123 谢谢,找到了
by phoenixzhan @ 2023-08-20 13:26:52
草绿色的AC: https://www.luogu.com.cn/record/121900001
by phoenixzhan @ 2023-08-20 13:39:23
@xiazeyu123 大佬做了56道红题,%%%,教教蒟蒻怎么快速做红题
现在做一道红题需要20min~1h不等,tcl
by Heartstrings @ 2023-08-20 13:44:17
@_CCF ???一道红题要这么久吗
确定不是20s~1min不等
by phoenixzhan @ 2023-08-20 13:46:04
@lonely_conqueror 经常一调20~40分钟,tcl