#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
int n;
cin >> n;
vector<int> v[3];
auto f = [&](vector<int> &v, vector<int> &u) -> bool {
int x = (int)v.size() - 1, y = (int)u.size() - 1;
while (min(x, y) >= 0 && v[x] > u[y]) {
x--; y--;
}
return (y == -1);
};
while (n--) {
int r, s;
cin >> r >> s;
v[s].push_back(r);
sort(v[s].begin(), v[s].end());
cout << (f(v[1], v[2]) ? '>' : (f(v[2], v[1]) ? '<' : '?')) << '\n';
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
500 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Correct |
4 ms |
348 KB |
Output is correct |
8 |
Correct |
7 ms |
600 KB |
Output is correct |
9 |
Correct |
5 ms |
500 KB |
Output is correct |
10 |
Correct |
620 ms |
736 KB |
Output is correct |
11 |
Execution timed out |
1018 ms |
748 KB |
Time limit exceeded |
12 |
Halted |
0 ms |
0 KB |
- |