#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f first
#define s second
#define sz(a) ((int)(a).size())
#define all(a) (a).begin(), (a).end()
#define uni(a) sort(all(a)), (a).resize(unique(all(a)) - (a).begin())
typedef pair <int, int> ii;
const int N = 1e5 + 10;
int n, ans[N], r[N], s[N], mx[4];
ll sum[4];
void solve() {
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> r[i] >> s[i];
}
for (int i = 1; i <= n; i++) {
mx[s[i]] = max(mx[s[i]], r[i]);
sum[s[i]] += r[i];
if (sum[1] >= sum[2]) {
ans[i] |= 1;
}
if (sum[1] <= sum[2]) {
ans[i] |= 2;
}
if (mx[1] > mx[2]) {
ans[i] |= 1;
}
if (mx[1] < mx[2]) {
ans[i] |= 2;
}
}
for (int i = 1; i <= n; i++) {
cout << (ans[i] == 1 ? ">" : ans[i] == 2 ? "<" : "?") << '\n';
}
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
// freopen("a.inp", "r", stdin);
// freopen("a.out", "w", stdout);
int t = 1;
// cin >> t;
while (t--) {
solve();
}
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |