| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 365335 | admin_wgf | 【C6-9】链表操作 | C++ | Accepted | 100 | 2 MS | 252 KB | 812 | 2025-12-05 19:44:21 |
#include<bits/stdc++.h> using namespace std; int n,m,a,opt,x,y,z; int main(){ cin>>n>>m; vector<int> v(n); for(int i=0;i<n;i++) cin>>v[i]; while(m--){ cin>>opt; if(opt==1){ cin>>x>>y; v.insert(v.begin()+x,y); }else if(opt==2){ cin>>x; v.erase(v.begin()+x-1); }else if(opt==3){ cin>>x>>y; sort(v.begin()+x-1,v.begin()+y); }else if(opt==4){ cin>>x>>y; reverse(v.begin()+x-1,v.begin()+y); }else if(opt==5){ cin>>x>>y>>z; for(int i=x-1;i<=y-1;i++) if(v[i]==z) v.erase(v.begin()+i); } } for(int i=0;i<v.size();i++){ cout<<v[i]<<" "; } return 0; }