我的提交记录:link
code:
#include <bits/stdc++.h>
#define el "\n"
#define sp " "
#define fi first
#define se second
#define inf 1e18
#define r0 return 0
#define int long long
#define F(i, a, b, c) for (int i = a; i <= b; i += c)
#define debug printf ("bug is in here\n")
#define TheEnd continue
#define base(s) s = sp + s
#define lcm(a, b) a / __gcd(a, b) * b
#define setp(x) fixed << setprecision(x)
using namespace std;
typedef long long ll;
typedef string str;
using ull = unsigned ll;
str s;
signed main(void) {
std::ios::sync_with_stdio(false);
std::cin.tie(0);
std::cout.tie(0);
cin >> s;
int n = s.size();
cout << "+(";
F(i, 0, n - 1, 1) {
if (i >= 1) {
cout << "+";
}
cout << "(";
s[i] -= '0';
F(j, 1, s[i], 1) {
cout << "+!![]";
}
cout << "+[])";
}
cout << ")" << el;
r0;
}
看讨论区说是SPJ抽风了,待会就好是吗。