救救我
查看原帖
救救我
589776
shenyuze楼主2022/1/16 09:26
#include<iostream>
using namespace std;
int a,b,c,d,w[10005],ans;
int main(){
    cin>>a>>b;
    for(int i=1;i<=b;i++)
    {
    	cin>>c>>d;
    	for(d;d>=c;d--)
    	{
    		w[d]++;
		}
	}
	for(int j=1;j<=a;j++)
	{
		if(w[j]==0) ans++;
	}
	ans++;
	cout<<ans;
    return 0;
}

呜呜呜,wa了一个测试点

2022/1/16 09:26
加载中...