第九届中国大学生程序设计竞赛(哈尔滨)123456789101112131415161718192021222324252627282930313233343536#include <bits/stdc++.h>using namespace std;using ll = long long;int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int sum = 0, f = 0; string ans; int q; cin >> q; while (q--) { int x; cin >> x; sum += x; if (sum > 0 || sum == 0 && f == 1) { ans += '+'; } else if (sum < 0 || sum == 0 && f == -1) { ans += '-'; } else { ans += '0'; } if (sum % 2) f = sum % 2; sum /= 2; } cout << ans << "\n"; return 0;}