lyxsunday @ 2022-08-07 17:32:31
https://www.luogu.com.cn/record/82834528
by lyxsunday @ 2022-08-07 17:32:59
↑我的提交记录
by lyxsunday @ 2022-08-07 17:34:19
#include<bits/stdc++.h>
using namespace std;
int l,m,L,R,ans;
bool tree[1001];
int main()
{
cin>>l>>m;
for(int i=1;i<=l;i++)
{
tree[i]=true;
}
for(int i=1;i<=m;i++)
{
cin>>L>>R;
for(int j=L;j<=R;j++)
{
tree[j]=false;
}
}
for(int i=1;i<=l;i++)
{
if(tree[i]==true)
{
ans++;
}
}
cout<<ans;
return 0;
}
by IGJHL @ 2022-08-07 17:36:08
RE
一般是数组开小了,题目中说
by lyxsunday @ 2022-08-07 17:36:39
啊,我我瞎了
by lyxsunday @ 2022-08-07 17:37:03
@OI_Loser_IGJHL 感谢提醒
by lyxsunday @ 2022-08-07 17:37:50
https://www.luogu.com.cn/record/82835549
by IGJHL @ 2022-08-07 17:38:58
@lyxsunday 我看看
by lyxsunday @ 2022-08-07 17:39:15
QwQ 变成 1AC 9WA 了
by lyxsunday @ 2022-08-07 17:40:44
下载了第二个测试点发现我的答案比正确答案少了1
by IGJHL @ 2022-08-07 17:43:11
即