답안 #568556

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
568556 2022-05-25T16:49:58 Z piOOE 새 집 (APIO18_new_home) C++17
100 / 100
3784 ms 178932 KB
//#define _GLIBCXX_DEBUG
 
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
#include <bits/stdc++.h>
 
using namespace std;
 
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace __gnu_pbds;
 
template<typename T>
using ordered_set = tree<T, null_type, less < T>, rb_tree_tag, tree_order_statistics_node_update>;
 
template<typename T>
using normal_queue = priority_queue <T, vector<T>, greater<>>;
 
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
 
#define ll long long
#define trace(x) cout << #x << ": " << (x) << endl;
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define uniq(x) x.resize(unique(all(x)) - begin(x))
#define ld long double
#define sz(s) ((int) size(s))
#define pii pair<int, int>
#define mp(x, y) make_pair(x, y)
#define int128 __int128
#define pb push_back
#define eb emplace_back
 
 
template<typename T>
bool ckmn(T &x, T y) {
    if (x > y) {
        x = y;
        return true;
    }
    return false;
}
 
template<typename T>
bool ckmx(T &x, T y) {
    if (x < y) {
        x = y;
        return true;
    }
    return false;
}
 
int bit(int x, int b) {
    return (x >> b) & 1;
}
 
int rand(int l, int r) { return (int) ((ll) rnd() % (r - l + 1)) + l; }
 
//soryan za musor sverhu
 
const ll infL = 3e18;
const int infI = 1000000000 + 7;
const int infM = 2139062143;
const int N = 500001;
const int mod = 1e9 + 7;
const ld eps = 1e-9;
 
#define int ll
 
template<typename T>
struct SegTreeDownMax {
    const T MIN = numeric_limits<T>::min() / 2;
    vector <T> t;
    int sz;
 
    void init(int n, T x = numeric_limits<T>::min() / 2) {
        sz = n;
        t.assign(sz << 1, x);
    }
 
    void st(int i, T v) {
        int x = i + sz;
        t[x] = v;
        x >>= 1;
        while (x) {
            t[x] = max(t[x << 1], t[x << 1 | 1]);
            x >>= 1;
        }
    }
 
    T get(int l, int r) {
        l += sz;
        r += sz;
        // [l, r)
        T ans = MIN;
        while (l < r) {
            if (l & 1) {
                //it is a right child
                ckmx(ans, t[l++]);
            }
            if (r & 1) {
                //this is a left child
                ckmx(ans, t[--r]);
            }
            l >>= 1;
            r >>= 1;
        }
        return ans;
    }
 
};
 
template<typename T>
struct SegTreeDownMin {
    const T MAX = numeric_limits<T>::max() / 2;
    vector <T> t;
    int sz;
 
    void init(int n, T x = numeric_limits<T>::max() / 2) {
        sz = n;
        t.assign(sz << 1, x);
    }
 
    void st(int i, T v) {
        int x = i + sz;
        t[x] = v;
        x >>= 1;
        while (x) {
            t[x] = min(t[x << 1], t[x << 1 | 1]);
            x >>= 1;
        }
    }
 
    T get(int l, int r) { // [l, r)
        T ans = MAX;
        l += sz;
        r += sz;
        while (l < r) {
            if (l & 1) {
                //it is a right child
                ckmn(ans, t[l++]);
            }
            if (r & 1) {
                //this is a left child
                ckmn(ans, t[--r]);
            }
            l >>= 1;
            r >>= 1;
        }
        return ans;
    }
 
};
 
struct Q {
    int x, t, i, type;
 
    Q(int a, int b, int c, int d) {
        x = a, t = b, i = c, type = d;
    }
 
    Q() = default;
 
};
 
bool cmp(Q a, Q b) {
    if (a.t != b.t) return a.t < b.t;
    return a.type < b.type;
}
 
int x[N], a[N], b[N], t[N];
int X[N], T[N], cnt[N];
multiset<int> g[N];
ll ans[N];
 
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, k, q;
    cin >> n >> k >> q;
    vector<Q> v;
 
    vector<array<int, 4>> yy;
    for (int i = 0; i < n; ++i) {
        cin >> x[i] >> t[i] >> a[i] >> b[i];
        --t[i];
        v.emplace_back(x[i], b[i], i, 1);
        v.eb(x[i], a[i], i, -1);
    }
    for (int i = 0; i < q; ++i) {
        cin >> X[i] >> T[i];
        yy.pb({X[i], -1, -1, -1});
        v.eb(X[i], T[i], i, 0);
    }
 
    SegTreeDownMax<ll> stx;
    SegTreeDownMin<ll> stm;
    multiset<ll> L, R;
    auto dod = [&](int l, int r, int i) {
        int mid = (l + r) >> 1;
        yy.pb({mid, l, r, i});
    };
 
    auto find = [&](int x, int type) -> int {
        array nw = {x, type, -1ll, -1ll};
        return lower_bound(all(yy), nw) - begin(yy);
    };
    auto add = [&](int l, int r, int i) {
        int MMid = (l + r) >> 1;
        array nw = {MMid, l, r, i};
        int mid = lower_bound(all(yy), nw) - begin(yy);
        stx.st(mid, r);
        stm.st(mid, l);
    };
 
    auto del = [&](int l, int r, int i) {
        int MMid = (l + r) >> 1;
        array nw = {MMid, l, r, i};
        int mid = lower_bound(all(yy), nw) - begin(yy);
        stm.st(mid, stm.MAX);
        stx.st(mid, stx.MIN);
    };
 
    auto addR = [&](int x, int i) {
        R.insert(x);
    };
 
    auto delR = [&](int x, int i) {
        R.extract(x);
    };
    auto addL = [&](int x, int i) {
        L.insert(x);
    };
 
    auto delL = [&](int x, int i) {
        L.extract(x);
    };
    sort(all(v), cmp);
    {
        int num = 0;
        for (auto to: v) {
            if (to.type == -1) {
                int i = to.i;
                auto it = g[t[i]].upper_bound(x[i]);
                if (it != end(g[t[i]])) {
                    dod(x[i], *it, t[i]);
                }
                if (it != begin(g[t[i]])) {
                    it = prev(it);
                    dod(*it, x[i], t[i]);
                }
                g[t[i]].insert(x[i]);
                ++cnt[t[i]];
                assert(sz(g[t[i]]) == cnt[t[i]]);
            } else if (to.type == 1) {
                int i = to.i;
                auto it = g[t[i]].find(x[i]);
                assert(it != end(g[t[i]]));
                if (it != begin(g[t[i]]) && it != prev(end(g[t[i]]))) {
                    dod(*prev(it), *next(it), t[i]);
                }
                g[t[i]].erase(it);
                --cnt[t[i]];
                assert(sz(g[t[i]]) == cnt[t[i]]);
            }
        }
    }
    for (int i = 0; i < k; ++i) {
        if (!g[i].empty()) {
            assert(cnt[i]);
            exit(1);
        }
        assert(g[i].empty());
    }
    assert(*max_element(all(cnt)) == 0);
    sort(all(yy));
    uniq(yy);
    stm.init(sz(yy));
    stx.init(sz(yy));
    {
        int num = 0;
        for (auto to: v) {
            if (to.type == -1) {
                int i = to.i;
//                for (int z : g[t[i]]) cout << z << " ";
//                cout << endl;
                auto &st = g[t[i]];
                auto it = st.upper_bound(x[i]);
//                if (it != end(g[t[i]])) {
//                    trace(*it)
//                }
                if (it != begin(g[t[i]]) && it != end(g[t[i]])) {
                    del(*prev(it), *it, t[i]);
                }
                if (it != end(st)) {
                    add(x[i], *it, t[i]);
                } else {
                    if (!st.empty()) {
                        delR(*st.rbegin(), t[i]);
                    }
                    addR(x[i], t[i]);
                }
                if (it != begin(g[t[i]])) {
                    it = prev(it);
                    add(*it, x[i], t[i]);
                } else {
                    if (!st.empty()) {
                        delL(*begin(st), t[i]);
                    }
                    addL(x[i], t[i]);
                }
                g[t[i]].insert(x[i]);
                if (cnt[t[i]] == 0) ++num;
                ++cnt[t[i]];
            } else if (to.type == 1) {
                int i = to.i;
                auto &st = g[t[i]];
                auto it = g[t[i]].find(x[i]);
                assert(it != end(g[t[i]]));
                if (it == prev(end(st))) {
                    delR(x[i], t[i]);
                    if (sz(st) != 1) {
                        del(*prev(it), x[i], t[i]);
                        addR(*prev(it), t[i]);
                    }
                }
                if (it == begin(st)) {
                    delL(x[i], t[i]);
                    if (sz(st) != 1) {
                        del(x[i], *next(it), t[i]);
                        addL(*next(it), t[i]);
                    }
                }
                if (it != begin(st) && it != prev(end(st))){
                    del(x[i], *next(it), t[i]);
                    del(*prev(it), x[i], t[i]);
                    add(*prev(it), *next(it), t[i]);
                }
                g[t[i]].erase(it);
                --cnt[t[i]];
                if (cnt[t[i]] == 0) --num;
            } else {
                int i = to.i;
                if (num != k) {
                    ans[i] = -1;
                } else {
                    int id = find(X[i], -1);
//                    trace(yy[id][0])
//                    trace(X[i] - stm.get(id, stx.sz))
//                    trace(stx.get(0, id) - X[i])
//                    trace(X[i] - *begin(R));
//                    trace(*rbegin(L) - X[i])
//                    assert(!L.empty());
//                    assert(!R.empty());
//                    trace(id)
                    ans[i] = max({X[i] - stm.get(id, stx.sz), stx.get(0, id) - X[i], X[i] - *begin(R), *rbegin(L) - X[i]});
                    assert(ans[i] <= 100000000 && ans[i] >= 0);
                }
            }
        }
    }
    for (int i = 0; i < q; ++i) cout << ans[i] << '\n';
    return 0;
}

Compilation message

new_home.cpp: In function 'int main()':
new_home.cpp:242:13: warning: unused variable 'num' [-Wunused-variable]
  242 |         int num = 0;
      |             ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 23892 KB Output is correct
2 Correct 14 ms 23832 KB Output is correct
3 Correct 14 ms 23764 KB Output is correct
4 Correct 14 ms 23828 KB Output is correct
5 Correct 18 ms 24016 KB Output is correct
6 Correct 20 ms 23944 KB Output is correct
7 Correct 22 ms 23964 KB Output is correct
8 Correct 22 ms 24020 KB Output is correct
9 Correct 17 ms 23964 KB Output is correct
10 Correct 17 ms 24020 KB Output is correct
11 Correct 15 ms 23964 KB Output is correct
12 Correct 15 ms 24040 KB Output is correct
13 Correct 15 ms 23944 KB Output is correct
14 Correct 24 ms 24020 KB Output is correct
15 Correct 15 ms 24020 KB Output is correct
16 Correct 14 ms 23924 KB Output is correct
17 Correct 14 ms 23920 KB Output is correct
18 Correct 16 ms 23976 KB Output is correct
19 Correct 18 ms 23948 KB Output is correct
20 Correct 18 ms 24020 KB Output is correct
21 Correct 18 ms 24020 KB Output is correct
22 Correct 14 ms 23928 KB Output is correct
23 Correct 18 ms 23948 KB Output is correct
24 Correct 15 ms 24020 KB Output is correct
25 Correct 15 ms 24020 KB Output is correct
26 Correct 16 ms 24008 KB Output is correct
27 Correct 14 ms 23920 KB Output is correct
28 Correct 15 ms 23916 KB Output is correct
29 Correct 14 ms 23960 KB Output is correct
30 Correct 20 ms 23992 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 23892 KB Output is correct
2 Correct 14 ms 23832 KB Output is correct
3 Correct 14 ms 23764 KB Output is correct
4 Correct 14 ms 23828 KB Output is correct
5 Correct 18 ms 24016 KB Output is correct
6 Correct 20 ms 23944 KB Output is correct
7 Correct 22 ms 23964 KB Output is correct
8 Correct 22 ms 24020 KB Output is correct
9 Correct 17 ms 23964 KB Output is correct
10 Correct 17 ms 24020 KB Output is correct
11 Correct 15 ms 23964 KB Output is correct
12 Correct 15 ms 24040 KB Output is correct
13 Correct 15 ms 23944 KB Output is correct
14 Correct 24 ms 24020 KB Output is correct
15 Correct 15 ms 24020 KB Output is correct
16 Correct 14 ms 23924 KB Output is correct
17 Correct 14 ms 23920 KB Output is correct
18 Correct 16 ms 23976 KB Output is correct
19 Correct 18 ms 23948 KB Output is correct
20 Correct 18 ms 24020 KB Output is correct
21 Correct 18 ms 24020 KB Output is correct
22 Correct 14 ms 23928 KB Output is correct
23 Correct 18 ms 23948 KB Output is correct
24 Correct 15 ms 24020 KB Output is correct
25 Correct 15 ms 24020 KB Output is correct
26 Correct 16 ms 24008 KB Output is correct
27 Correct 14 ms 23920 KB Output is correct
28 Correct 15 ms 23916 KB Output is correct
29 Correct 14 ms 23960 KB Output is correct
30 Correct 20 ms 23992 KB Output is correct
31 Correct 565 ms 53192 KB Output is correct
32 Correct 238 ms 49248 KB Output is correct
33 Correct 535 ms 51756 KB Output is correct
34 Correct 530 ms 51508 KB Output is correct
35 Correct 556 ms 53452 KB Output is correct
36 Correct 559 ms 53572 KB Output is correct
37 Correct 321 ms 51708 KB Output is correct
38 Correct 364 ms 51704 KB Output is correct
39 Correct 275 ms 50100 KB Output is correct
40 Correct 300 ms 50412 KB Output is correct
41 Correct 276 ms 47524 KB Output is correct
42 Correct 279 ms 47548 KB Output is correct
43 Correct 154 ms 43536 KB Output is correct
44 Correct 296 ms 47572 KB Output is correct
45 Correct 275 ms 47484 KB Output is correct
46 Correct 254 ms 47428 KB Output is correct
47 Correct 169 ms 43396 KB Output is correct
48 Correct 205 ms 43536 KB Output is correct
49 Correct 189 ms 47280 KB Output is correct
50 Correct 210 ms 44128 KB Output is correct
51 Correct 193 ms 47144 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3253 ms 139740 KB Output is correct
2 Correct 3428 ms 173992 KB Output is correct
3 Correct 1571 ms 145768 KB Output is correct
4 Correct 2890 ms 142836 KB Output is correct
5 Correct 3290 ms 173948 KB Output is correct
6 Correct 3373 ms 173876 KB Output is correct
7 Correct 1400 ms 145616 KB Output is correct
8 Correct 2048 ms 141568 KB Output is correct
9 Correct 2275 ms 152236 KB Output is correct
10 Correct 2930 ms 175580 KB Output is correct
11 Correct 1573 ms 174664 KB Output is correct
12 Correct 1571 ms 175500 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3784 ms 170928 KB Output is correct
2 Correct 1250 ms 168964 KB Output is correct
3 Correct 3321 ms 170340 KB Output is correct
4 Correct 1215 ms 138328 KB Output is correct
5 Correct 2447 ms 144064 KB Output is correct
6 Correct 2340 ms 140712 KB Output is correct
7 Correct 3071 ms 172748 KB Output is correct
8 Correct 3211 ms 172816 KB Output is correct
9 Correct 1426 ms 143416 KB Output is correct
10 Correct 2359 ms 141760 KB Output is correct
11 Correct 2784 ms 156756 KB Output is correct
12 Correct 3034 ms 173360 KB Output is correct
13 Correct 1188 ms 171576 KB Output is correct
14 Correct 1159 ms 171264 KB Output is correct
15 Correct 1353 ms 172660 KB Output is correct
16 Correct 1530 ms 173684 KB Output is correct
17 Correct 1411 ms 172664 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 23892 KB Output is correct
2 Correct 14 ms 23832 KB Output is correct
3 Correct 14 ms 23764 KB Output is correct
4 Correct 14 ms 23828 KB Output is correct
5 Correct 18 ms 24016 KB Output is correct
6 Correct 20 ms 23944 KB Output is correct
7 Correct 22 ms 23964 KB Output is correct
8 Correct 22 ms 24020 KB Output is correct
9 Correct 17 ms 23964 KB Output is correct
10 Correct 17 ms 24020 KB Output is correct
11 Correct 15 ms 23964 KB Output is correct
12 Correct 15 ms 24040 KB Output is correct
13 Correct 15 ms 23944 KB Output is correct
14 Correct 24 ms 24020 KB Output is correct
15 Correct 15 ms 24020 KB Output is correct
16 Correct 14 ms 23924 KB Output is correct
17 Correct 14 ms 23920 KB Output is correct
18 Correct 16 ms 23976 KB Output is correct
19 Correct 18 ms 23948 KB Output is correct
20 Correct 18 ms 24020 KB Output is correct
21 Correct 18 ms 24020 KB Output is correct
22 Correct 14 ms 23928 KB Output is correct
23 Correct 18 ms 23948 KB Output is correct
24 Correct 15 ms 24020 KB Output is correct
25 Correct 15 ms 24020 KB Output is correct
26 Correct 16 ms 24008 KB Output is correct
27 Correct 14 ms 23920 KB Output is correct
28 Correct 15 ms 23916 KB Output is correct
29 Correct 14 ms 23960 KB Output is correct
30 Correct 20 ms 23992 KB Output is correct
31 Correct 565 ms 53192 KB Output is correct
32 Correct 238 ms 49248 KB Output is correct
33 Correct 535 ms 51756 KB Output is correct
34 Correct 530 ms 51508 KB Output is correct
35 Correct 556 ms 53452 KB Output is correct
36 Correct 559 ms 53572 KB Output is correct
37 Correct 321 ms 51708 KB Output is correct
38 Correct 364 ms 51704 KB Output is correct
39 Correct 275 ms 50100 KB Output is correct
40 Correct 300 ms 50412 KB Output is correct
41 Correct 276 ms 47524 KB Output is correct
42 Correct 279 ms 47548 KB Output is correct
43 Correct 154 ms 43536 KB Output is correct
44 Correct 296 ms 47572 KB Output is correct
45 Correct 275 ms 47484 KB Output is correct
46 Correct 254 ms 47428 KB Output is correct
47 Correct 169 ms 43396 KB Output is correct
48 Correct 205 ms 43536 KB Output is correct
49 Correct 189 ms 47280 KB Output is correct
50 Correct 210 ms 44128 KB Output is correct
51 Correct 193 ms 47144 KB Output is correct
52 Correct 189 ms 48680 KB Output is correct
53 Correct 159 ms 43380 KB Output is correct
54 Correct 359 ms 48460 KB Output is correct
55 Correct 254 ms 46404 KB Output is correct
56 Correct 240 ms 46968 KB Output is correct
57 Correct 278 ms 48592 KB Output is correct
58 Correct 240 ms 46356 KB Output is correct
59 Correct 229 ms 46896 KB Output is correct
60 Correct 255 ms 48592 KB Output is correct
61 Correct 148 ms 46584 KB Output is correct
62 Correct 213 ms 48960 KB Output is correct
63 Correct 283 ms 47296 KB Output is correct
64 Correct 305 ms 46764 KB Output is correct
65 Correct 296 ms 46404 KB Output is correct
66 Correct 265 ms 47512 KB Output is correct
67 Correct 251 ms 46700 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 23892 KB Output is correct
2 Correct 14 ms 23832 KB Output is correct
3 Correct 14 ms 23764 KB Output is correct
4 Correct 14 ms 23828 KB Output is correct
5 Correct 18 ms 24016 KB Output is correct
6 Correct 20 ms 23944 KB Output is correct
7 Correct 22 ms 23964 KB Output is correct
8 Correct 22 ms 24020 KB Output is correct
9 Correct 17 ms 23964 KB Output is correct
10 Correct 17 ms 24020 KB Output is correct
11 Correct 15 ms 23964 KB Output is correct
12 Correct 15 ms 24040 KB Output is correct
13 Correct 15 ms 23944 KB Output is correct
14 Correct 24 ms 24020 KB Output is correct
15 Correct 15 ms 24020 KB Output is correct
16 Correct 14 ms 23924 KB Output is correct
17 Correct 14 ms 23920 KB Output is correct
18 Correct 16 ms 23976 KB Output is correct
19 Correct 18 ms 23948 KB Output is correct
20 Correct 18 ms 24020 KB Output is correct
21 Correct 18 ms 24020 KB Output is correct
22 Correct 14 ms 23928 KB Output is correct
23 Correct 18 ms 23948 KB Output is correct
24 Correct 15 ms 24020 KB Output is correct
25 Correct 15 ms 24020 KB Output is correct
26 Correct 16 ms 24008 KB Output is correct
27 Correct 14 ms 23920 KB Output is correct
28 Correct 15 ms 23916 KB Output is correct
29 Correct 14 ms 23960 KB Output is correct
30 Correct 20 ms 23992 KB Output is correct
31 Correct 565 ms 53192 KB Output is correct
32 Correct 238 ms 49248 KB Output is correct
33 Correct 535 ms 51756 KB Output is correct
34 Correct 530 ms 51508 KB Output is correct
35 Correct 556 ms 53452 KB Output is correct
36 Correct 559 ms 53572 KB Output is correct
37 Correct 321 ms 51708 KB Output is correct
38 Correct 364 ms 51704 KB Output is correct
39 Correct 275 ms 50100 KB Output is correct
40 Correct 300 ms 50412 KB Output is correct
41 Correct 276 ms 47524 KB Output is correct
42 Correct 279 ms 47548 KB Output is correct
43 Correct 154 ms 43536 KB Output is correct
44 Correct 296 ms 47572 KB Output is correct
45 Correct 275 ms 47484 KB Output is correct
46 Correct 254 ms 47428 KB Output is correct
47 Correct 169 ms 43396 KB Output is correct
48 Correct 205 ms 43536 KB Output is correct
49 Correct 189 ms 47280 KB Output is correct
50 Correct 210 ms 44128 KB Output is correct
51 Correct 193 ms 47144 KB Output is correct
52 Correct 3253 ms 139740 KB Output is correct
53 Correct 3428 ms 173992 KB Output is correct
54 Correct 1571 ms 145768 KB Output is correct
55 Correct 2890 ms 142836 KB Output is correct
56 Correct 3290 ms 173948 KB Output is correct
57 Correct 3373 ms 173876 KB Output is correct
58 Correct 1400 ms 145616 KB Output is correct
59 Correct 2048 ms 141568 KB Output is correct
60 Correct 2275 ms 152236 KB Output is correct
61 Correct 2930 ms 175580 KB Output is correct
62 Correct 1573 ms 174664 KB Output is correct
63 Correct 1571 ms 175500 KB Output is correct
64 Correct 3784 ms 170928 KB Output is correct
65 Correct 1250 ms 168964 KB Output is correct
66 Correct 3321 ms 170340 KB Output is correct
67 Correct 1215 ms 138328 KB Output is correct
68 Correct 2447 ms 144064 KB Output is correct
69 Correct 2340 ms 140712 KB Output is correct
70 Correct 3071 ms 172748 KB Output is correct
71 Correct 3211 ms 172816 KB Output is correct
72 Correct 1426 ms 143416 KB Output is correct
73 Correct 2359 ms 141760 KB Output is correct
74 Correct 2784 ms 156756 KB Output is correct
75 Correct 3034 ms 173360 KB Output is correct
76 Correct 1188 ms 171576 KB Output is correct
77 Correct 1159 ms 171264 KB Output is correct
78 Correct 1353 ms 172660 KB Output is correct
79 Correct 1530 ms 173684 KB Output is correct
80 Correct 1411 ms 172664 KB Output is correct
81 Correct 189 ms 48680 KB Output is correct
82 Correct 159 ms 43380 KB Output is correct
83 Correct 359 ms 48460 KB Output is correct
84 Correct 254 ms 46404 KB Output is correct
85 Correct 240 ms 46968 KB Output is correct
86 Correct 278 ms 48592 KB Output is correct
87 Correct 240 ms 46356 KB Output is correct
88 Correct 229 ms 46896 KB Output is correct
89 Correct 255 ms 48592 KB Output is correct
90 Correct 148 ms 46584 KB Output is correct
91 Correct 213 ms 48960 KB Output is correct
92 Correct 283 ms 47296 KB Output is correct
93 Correct 305 ms 46764 KB Output is correct
94 Correct 296 ms 46404 KB Output is correct
95 Correct 265 ms 47512 KB Output is correct
96 Correct 251 ms 46700 KB Output is correct
97 Correct 1401 ms 137784 KB Output is correct
98 Correct 1146 ms 169336 KB Output is correct
99 Correct 3319 ms 178784 KB Output is correct
100 Correct 1247 ms 121644 KB Output is correct
101 Correct 2478 ms 146800 KB Output is correct
102 Correct 3408 ms 178788 KB Output is correct
103 Correct 2398 ms 178912 KB Output is correct
104 Correct 2173 ms 178932 KB Output is correct
105 Correct 1359 ms 157000 KB Output is correct
106 Correct 1431 ms 178804 KB Output is correct
107 Correct 1784 ms 137824 KB Output is correct
108 Correct 1713 ms 140104 KB Output is correct
109 Correct 1803 ms 140236 KB Output is correct
110 Correct 1809 ms 137156 KB Output is correct
111 Correct 1729 ms 139476 KB Output is correct
112 Correct 1751 ms 139404 KB Output is correct
113 Correct 585 ms 137716 KB Output is correct
114 Correct 1401 ms 148848 KB Output is correct
115 Correct 2295 ms 141680 KB Output is correct
116 Correct 2422 ms 138652 KB Output is correct
117 Correct 2389 ms 139332 KB Output is correct
118 Correct 1858 ms 140796 KB Output is correct
119 Correct 1965 ms 130124 KB Output is correct
120 Correct 636 ms 126232 KB Output is correct
121 Correct 792 ms 128096 KB Output is correct
122 Correct 746 ms 127604 KB Output is correct
123 Correct 823 ms 128840 KB Output is correct
124 Correct 899 ms 129840 KB Output is correct
125 Correct 871 ms 128744 KB Output is correct
126 Correct 937 ms 129872 KB Output is correct