Submission #691588

# Submission time Handle Problem Language Result Execution time Memory
691588 2023-01-31T09:53:44 Z drdilyor Weighting stones (IZhO11_stones) C++17
0 / 100
1000 ms 212 KB
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

signed main() {
    cin.tie(0)->sync_with_stdio(0);
    int q; cin >> q;
    set<int> a, b;
    while (q--) {
        int r, s;
        cin >> r >> s;
        if (s ==1) {
            a.insert(r);
        } else b.insert(r);
        auto ca = a, cb = b;
        int f1 = 1, f2 = 1;
        for (int i : a) {
            auto it = cb.lower_bound(i);
            if (it == cb.end()) f1 = false;
            cb.erase(it);
        }
        for (int i : b) {
            auto it = ca.lower_bound(i);
            if (it == ca.end()) f2 = false;
            ca.erase(it);
        }
        if (f1) cout << "<\n";
        else if (f2) cout << ">\n";
        else cout << "?\n";
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Execution timed out 1085 ms 212 KB Time limit exceeded
2 Halted 0 ms 0 KB -