2020-09-20 07:21:40 +00:00
|
|
|
// https://www.luogu.com.cn/record/38657002
|
|
|
|
|
|
|
|
#include <bits/stdc++.h>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
string cnm() {
|
2021-11-19 09:01:13 +00:00
|
|
|
int n;
|
|
|
|
char ch;
|
|
|
|
string s = "";
|
2020-09-20 07:21:40 +00:00
|
|
|
string str = "";
|
|
|
|
|
|
|
|
while (cin >> ch) {
|
|
|
|
if (ch == '[') {
|
|
|
|
cin >> n;
|
|
|
|
str = cnm();
|
|
|
|
while (n--) {
|
|
|
|
s += str;
|
|
|
|
}
|
2021-11-19 09:01:13 +00:00
|
|
|
} else if (ch == ']') {
|
2020-09-20 07:21:40 +00:00
|
|
|
return s;
|
2021-11-19 09:01:13 +00:00
|
|
|
} else {
|
2020-09-20 07:21:40 +00:00
|
|
|
s += ch;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
cout << cnm() << endl;
|
|
|
|
return 0;
|
|
|
|
}
|