1 条题解

  • 0
    @ 2025-2-15 14:06:21
    #include<bits/stdc++.h>
    using namespace std;
    string expand(){
    	string s="",x;
    	char c;int d;
    	while(cin>>c){
    		if(c=='['){
    			cin>>d;
    			x=expand();
    			while(d--) s+=x;
    		}else if(c==']')return s;
    		else s+=c;
    	}
    	return s;
    }
    int main(){
    	cout<<expand();
    	return 0;
    }

    信息

    ID
    2342
    时间
    1000ms
    内存
    512MiB
    难度
    6
    标签
    递交数
    20
    已通过
    11
    上传者