1 条题解
-
2
我们使用强大的
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; }
信息
- ID
- 935
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 10
- 标签
- (无)
- 递交数
- 3
- 已通过
- 2
- 上传者