답안 #691589

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
691589 2023-01-31T09:54:20 Z drdilyor 돌 무게 재기 (IZhO11_stones) C++17
0 / 100
1000 ms 864 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;break;}
            cb.erase(it);
        }
        for (int i : b) {
            auto it = ca.lower_bound(i);
            if (it == ca.end()) {f2 = false;break;}
            ca.erase(it);
        }
        if (f1) cout << "<\n";
        else if (f2) cout << ">\n";
        else cout << "?\n";
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 7 ms 340 KB Output is correct
6 Correct 14 ms 340 KB Output is correct
7 Correct 36 ms 340 KB Output is correct
8 Correct 63 ms 396 KB Output is correct
9 Correct 51 ms 368 KB Output is correct
10 Execution timed out 1088 ms 864 KB Time limit exceeded
11 Halted 0 ms 0 KB -