2021panjiawang @ 2022-09-11 20:36:46
代码如下:
#include<iostream>
using namespace std;
int main()
{
int l,m;
cin>>l>>m;
int u,v;
bool a[++l];
for(int i=1;i<=l;i++) a[i]=1;
for(int i=1;i<=m;i++)
{
cin>>u>>v;
for(int j=u;j<=v;j++)
{
if(a[j]==1)
{
a[j]=0;
l--;
}
}
}
cout<<l<<endl;
}
by OoXiao_QioO @ 2022-09-11 20:37:46
图片假了
by Sprague_Garundy @ 2022-09-11 20:38:23
@OoXiao_QioO 你不应该注意一下标题吗?
by OoXiao_QioO @ 2022-09-11 20:38:27
马路的一端在数轴 0 的位置
by OoXiao_QioO @ 2022-09-11 20:38:48
@Sprague_Garundy 好家伙我还以为是求助
by StayAlone @ 2022-09-11 20:38:50
@2021panjiawang for循环 i 从 0 开始
by OoXiao_QioO @ 2022-09-11 20:39:02
@Sprague_Garundy 《变相认亲》
by pokefunc @ 2022-09-11 20:39:45
别吧,当场认亲真的好嘛
by Sprague_Garundy @ 2022-09-11 20:41:58
请从楼主标题角度,分析楼主调不出题的无奈之情。(3 分)
by 2021panjiawang @ 2022-09-11 20:44:12
@Sprague_Garundy 牛
by Paris_Commune @ 2022-09-11 20:44:43
@Sprague_Garundy 通过楼主当场认亲的尴尬举动,抒发了楼主的无奈与伤心之情