9 条题解

  • 0
    @ 2023-12-24 9:49:45

    #include #include <math.h> #include #include <stdio.h> #include #include #include #include <string.h> #include using namespace std; #define LL long long const int N = 1e4 + 10; const int INF = 0x3f3f3f3f; int n,p,h,m,x,y; bool v[N][N]; int cf[N],a[N]; int main() { cin>>n>>p>>h>>m; while(m--) { cin>>x>>y; if(v[x][y]) continue; if(x>y) swap(x,y); cf[x+1]--; cf[y]++; v[x][y]=1; } for(int i=1;i<=n;i++) { a[i]=a[i-1]+cf[i]; cout<<a[i]+h<<endl; }

    return 0;
    

    }

    信息

    ID
    13
    时间
    1000ms
    内存
    128MiB
    难度
    4
    标签
    递交数
    426
    已通过
    181
    上传者