1 条题解

  • 2
    @ 2026-10-23 8:51:12

    我们使用强大的 pb_ds 库中的 rope 即可快速解决。

    #include<bits/stdc++.h>
    #include<bits/extc++.h>
    using namespace std;
    using namespace __gnu_cxx;
    #define ll long long
    rope<int> tr;
    signed main(){
        cin.tie(0);
        ios::sync_with_stdio(false);
        int n,a;
        cin>>n;
        for(int i=1; i<=n; i++){
            cin>>a;
            tr.push_back(a);
        }
        for(int i=1; i<=n; i++){
            int op,l,r,c;
            cin>>op>>l>>r>>c;
            if(op==0) tr.insert(l-1,r);
            else cout<<tr[r-1]<<"\n";
        }
        return 0;
    }
    
    • @ 2026-11-3 11:39:26

      让我逝逝,我去太好用了。

信息

ID
935
时间
1000ms
内存
256MiB
难度
10
标签
(无)
递交数
3
已通过
2
上传者