神秘rope

#include<ext/rope>
using namespace __gnu_cxx;

ABC_D

vector<rope<char>>px;
rope<char>st;
void solve(){
    int n,q;cin>>n>>q;
    px.resize(n+1);
    while(q--){
        int opt;cin>>opt;
        int p;cin>>p;
        if(opt==1){
            px[p]=st;
        }else if(opt==2){
            string s;cin>>s;
            for(auto ch:s)px[p].pb(ch);
        }else{
            st=px[p];
        }
    }
    for(auto ch:st){cout<<ch;}
}
posted @ 2025-09-28 18:59  Marinaco  阅读(9)  评论(0)    收藏  举报
//雪花飘落效果