#大佬求助WA声一片
查看原帖
#大佬求助WA声一片
422110
HgSO4_QwQ楼主2021/2/13 21:54

为啥我WAWA声一片

代码:

#include<iostream>
using namespace std;

int main()
{
    int a,b;
    cin>>a>>b;
    int c[a];
    for(int i=0;i<a;i++)
    {
        c[i]=1;
    }
    for(int j=1;j<=b;j++)
    {
        int d,e;
        cin>>d>>e;
        for(int k=d;k<=e;k++)
        {
            c[k]=0;
        }
    }
    int f;
    for(int l=0;l<a+1;l++)
    {
        if(c[l]==1)
        {
            f++;
        }
    }
    cout<<f;
    return 0;
}
2021/2/13 21:54
加载中...