# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
888489 | stdfloat | Weighting stones (IZhO11_stones) | C++17 | 1 ms | 600 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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--] > v[y--]) {}
return (y == -1);
};
while (n--) {
int r, s;
cin >> r >> s;
v[s].push_back(r);
cout << (f(v[1], v[2]) ? '>' : (f(v[2], v[1]) ? '<' : '?')) << '\n';
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |