我看了下测试点,都是常规数据,没有毒瘤啊
卡在这个点了,125MB MLE
[2[2[2[2[2[2[2[2[2[2YEAH]]]]]]]]]]
#include<bits/stdc++.h>
using namespace std;
string f() {
string res = "", s;
int n;
for (char c = getchar(); c != '\n'; c = getchar())
if (c == '[') {
cin >> n;
s = f();
while (n--)res += s;
} else if (c == ']')return res;
else res += c;
return res;
}
int main() {
cout << f();
return 0;
}