G题,其实很简单,使用stl即可#include<bits/stdc++.h>#include<ext/rope>using namespace std;using namespace __gnu_cxx;rope<int>a;int n,m,x,y,i=1,j;main(){ cin>>n>>m; for(;i<=n;i++) a.push_back(i); for(;m--;) { cin>>x>>y; a.insert(0,a.sub...