3 条题解

  • 0
    @ 2024-1-29 17:05:18

    #include <bits/stdc++.h> using namespace std; int main(){ int q,x; cin>>q>>x; int t=0; int a[400005]; while(q--){ int m; cin>>m; a[m%x]++; while(a[t%x]){ a[t%x]--; t++; } cout<<t<<endl; } return 0; }

    信息

    ID
    498
    时间
    2000ms
    内存
    256MiB
    难度
    8
    标签
    (无)
    递交数
    16
    已通过
    7
    上传者