90求解有一个WA其他AC
查看原帖
90求解有一个WA其他AC
851570
shao3377168499楼主2022/10/28 14:45
#include<iostream>
using namespace std;
int main() {
    int l[10000],m,n=0,L,j,k,y=0;
    cin >> L>>m;
    for (int i = 0; i <= L; i++)
    {
        l[i]=n;
        n++;
    }
    for (int i = 0; i < m; i++)
    {
        cin >> j >> k;
        for(int d=0;d<=L;d++)
        if (j <= l[d] && l[d] <= k)
        {
            l[d] = 0;
        }
    }
    for (int x = 0; x <= L; x++)
    {
        if (l[x] != 0)
            y++;
    }
    cout << y+1;
    return 0;
}
2022/10/28 14:45
加载中...