Submission #1057600

# Submission time Handle Problem Language Result Execution time Memory
1057600 2024-08-13T23:19:45 Z sammyuri Gift Exchange (JOI24_ho_t4) C++17
100 / 100
1555 ms 64180 KB
#include <bits/stdc++.h>
using namespace std;

/*
for each index, calculate val[i],
the minimum index j > i such that they intersect
note that it is valid iff for all l, l + 1, .. , r - 1
val[i] <= r
so use a max segtree?

for each index, calculate closest left and right that is required
then we get an invalid range L..R
so we have n invalid ranges
and for each query, we want to find if it is contained in any of these ranges
go from left to right
and do sweep line
maintain it with multiset
3 events
*/

const int MAXN = (1 << 20);
int LEFT[MAXN], RIGHT[MAXN];
int tree[2 * MAXN];
int lazy[2 * MAXN];


void init() {
    for (int i = 0; i < MAXN * 2; i ++)
        tree[i] = 1e9, lazy[i] = 1e9;
}
void pushdown(int index) {
    if (lazy[index] != 1e9) {
        tree[index] = min(tree[index], lazy[index]);
        if (index < MAXN) {
            lazy[2 * index] = min(lazy[2 * index], lazy[index]);
            lazy[2 * index + 1] = min(lazy[2 * index + 1], lazy[index]);
        }
        lazy[index] = 1e9;
    }
}
void upd(int left, int right, int index, int maxl, int maxr, int value) {
    // cout << left << " " << right << " " << index << " " << value << " " << maxl << " " << maxr << endl;
    pushdown(index);
    if (left == maxl && right == maxr) {
        lazy[index] = min(lazy[index], value); return;
    }
    int mid = (maxl + maxr) / 2;
    if (left <= mid) {
        upd(left, min(mid, right), 2 * index, maxl, mid, value);
    }
    if (right >= mid + 1) {
        upd(max(mid + 1, left), right, 2 * index + 1, mid + 1, maxr, value);
    }
    if (index < MAXN) {
        pushdown(2 * index); pushdown(2 * index + 1);
        tree[index] = min(tree[2 * index], tree[2 * index + 1]);
    }
}
void upd(int l, int r, int val) {upd(l, r, 1, 0, MAXN - 1, val);}
int query(int left, int right, int index, int maxl, int maxr) {
    pushdown(index);
    if (left == maxl && right == maxr)
        return tree[index];
    int ans = 1e9;
    int mid = (maxl + maxr) / 2;
    if (left <= mid) {
        ans = min(ans, query(left, min(mid, right), 2 * index, maxl, mid));
    }
    if (right >= mid + 1) {
        ans = min(ans, query(max(mid + 1, left), right, 2 * index + 1, mid + 1, maxr));
    }
    return ans;
}
int query(int l, int r) {return query(l, r, 1, 0, MAXN - 1);}


int tree2[2 * MAXN];
void init2() {
    for (int i = 0; i < 2 * MAXN; i ++)
        tree2[i] = 0;
}
void upd2(int index, int value) {
    index += MAXN;
    tree2[index] += value;
    index /= 2;
    while (index) {
        tree2[index] = tree2[2 * index] + tree2[2 * index + 1];
        index /= 2;
    }
}
int query2(int left, int right, int index, int maxl, int maxr) {
    if (left == maxl && right == maxr)
        return tree2[index];
    int ans = 0;
    int mid = (maxl + maxr) / 2;
    if (left <= mid) {
        ans += query2(left, min(mid, right), 2 * index, maxl, mid);
    }
    if (right >= mid + 1) {
        ans += query2(max(mid + 1, left), right, 2 * index + 1, mid + 1, maxr);
    }
    return ans;
}
int query2(int l, int r) {return query2(l, r, 1, 0, MAXN - 1);}

#define BAD_BEGIN 0
#define QUERY 2
#define BAD_END 1

struct event {
    int type;
    int pos;
    int index;
    event (int _t, int _p, int _i) {type = _t, pos = _p, index = _i;}
};
bool operator < (event a, event b) {
    if (a.pos != b.pos)
        return a.pos < b.pos;
    if (a.type != b.type)
        return a.type < b.type;
    return a.index < b.index;
}

int main() {
    int n; cin >> n;
    vector<int> aa(n), bb(n);
    for (auto &a : aa) cin >> a;
    for (auto &a : bb) cin >> a;
    // find initial values
    init();
    for (int i = n - 1; i >= 0; i --) {
        RIGHT[i] = query(bb[i], aa[i]);
        upd(bb[i], aa[i], i);
    }
    // cout << query(1, 5) << endl;
    init();
    for (int i = 0; i < n; i ++) {
        LEFT[i] = n - 1 - query(bb[i], aa[i]);
        if (LEFT[i] < 0)
            LEFT[i] = -1;
        upd(bb[i], aa[i], n - 1 - i);
    }
    
    // for (int i = 0; i < n; i ++)
    //     cout << LEFT[i] << " "; cout << endl;
    // for (int i = 0; i < n; i ++)
    //     cout << RIGHT[i] << " "; cout << endl;

    vector<event> events;
    // add events to list
    for (int i = 0; i < n; i ++) {
        events.push_back(event(BAD_BEGIN, LEFT[i] + 1, i));
        events.push_back(event(BAD_END, i + 1, i));
    }
    int q; cin >> q;
    vector<bool> ans(q);
    vector<int> rights(q);
    for (int i = 0; i < q; i ++) {
        int l, r; cin >> l >> r;
        l --; r --;
        rights[i] = r;
        events.push_back(event(QUERY, l, i));
    }
    sort(events.begin(), events.end());
    // sweep line
    init2();
    for (auto a : events) {
        // cout << a.pos << " " << a.type << " " << a.index << endl;
        if (a.type == BAD_BEGIN) {
            upd2(a.index, 1);
            if (RIGHT[a.index] < MAXN)
                upd2(RIGHT[a.index], -1);
        } else if (a.type == BAD_END) {
            upd2(a.index, -1);
            if (RIGHT[a.index] < MAXN)
                upd2(RIGHT[a.index], 1);
        } else {
            int r = rights[a.index];
            int xx = query2(0, r);
            // cout << xx << endl;
            if (xx)
                ans[a.index] = false;
            else ans[a.index] = true;
        }
    }
    for (auto a : ans)
        cout << (a ? "Yes" : "No") << endl;
    return 0;
}

/*
10
2 5 8 10 12 14 16 17 19 20
1 4 7 6 11 13 9 3 18 15
1
2 9

5
3 4 6 9 10
1 2 5 7 8
1
1 2
*/
# Verdict Execution time Memory Grader output
1 Correct 5 ms 27224 KB Output is correct
2 Correct 5 ms 27224 KB Output is correct
3 Correct 5 ms 27228 KB Output is correct
4 Correct 5 ms 27228 KB Output is correct
5 Correct 6 ms 27224 KB Output is correct
6 Correct 5 ms 27228 KB Output is correct
7 Correct 5 ms 27228 KB Output is correct
8 Correct 5 ms 27068 KB Output is correct
9 Correct 5 ms 27228 KB Output is correct
10 Correct 5 ms 27228 KB Output is correct
11 Correct 5 ms 27228 KB Output is correct
12 Correct 5 ms 27228 KB Output is correct
13 Correct 5 ms 27228 KB Output is correct
14 Correct 5 ms 27228 KB Output is correct
15 Correct 5 ms 27100 KB Output is correct
16 Correct 5 ms 27228 KB Output is correct
17 Correct 5 ms 27224 KB Output is correct
18 Correct 5 ms 27228 KB Output is correct
19 Correct 5 ms 27096 KB Output is correct
20 Correct 5 ms 27228 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 27224 KB Output is correct
2 Correct 5 ms 27224 KB Output is correct
3 Correct 5 ms 27228 KB Output is correct
4 Correct 5 ms 27228 KB Output is correct
5 Correct 6 ms 27224 KB Output is correct
6 Correct 5 ms 27228 KB Output is correct
7 Correct 5 ms 27228 KB Output is correct
8 Correct 5 ms 27068 KB Output is correct
9 Correct 5 ms 27228 KB Output is correct
10 Correct 5 ms 27228 KB Output is correct
11 Correct 5 ms 27228 KB Output is correct
12 Correct 5 ms 27228 KB Output is correct
13 Correct 5 ms 27228 KB Output is correct
14 Correct 5 ms 27228 KB Output is correct
15 Correct 5 ms 27100 KB Output is correct
16 Correct 5 ms 27228 KB Output is correct
17 Correct 5 ms 27224 KB Output is correct
18 Correct 5 ms 27228 KB Output is correct
19 Correct 5 ms 27096 KB Output is correct
20 Correct 5 ms 27228 KB Output is correct
21 Correct 5 ms 27228 KB Output is correct
22 Correct 5 ms 27228 KB Output is correct
23 Correct 5 ms 27100 KB Output is correct
24 Correct 6 ms 27224 KB Output is correct
25 Correct 5 ms 27096 KB Output is correct
26 Correct 5 ms 27224 KB Output is correct
27 Correct 6 ms 27228 KB Output is correct
28 Correct 7 ms 27096 KB Output is correct
29 Correct 5 ms 27228 KB Output is correct
30 Correct 5 ms 27080 KB Output is correct
31 Correct 5 ms 27100 KB Output is correct
32 Correct 5 ms 27228 KB Output is correct
33 Correct 5 ms 27228 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 27088 KB Output is correct
2 Correct 5 ms 27228 KB Output is correct
3 Correct 5 ms 27072 KB Output is correct
4 Correct 264 ms 34876 KB Output is correct
5 Correct 232 ms 34640 KB Output is correct
6 Correct 237 ms 34752 KB Output is correct
7 Correct 231 ms 34640 KB Output is correct
8 Correct 245 ms 34760 KB Output is correct
9 Correct 233 ms 34624 KB Output is correct
10 Correct 235 ms 34648 KB Output is correct
11 Correct 237 ms 35264 KB Output is correct
12 Correct 242 ms 34752 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 27224 KB Output is correct
2 Correct 5 ms 27224 KB Output is correct
3 Correct 5 ms 27228 KB Output is correct
4 Correct 5 ms 27228 KB Output is correct
5 Correct 6 ms 27224 KB Output is correct
6 Correct 5 ms 27228 KB Output is correct
7 Correct 5 ms 27228 KB Output is correct
8 Correct 5 ms 27068 KB Output is correct
9 Correct 5 ms 27228 KB Output is correct
10 Correct 5 ms 27228 KB Output is correct
11 Correct 5 ms 27228 KB Output is correct
12 Correct 5 ms 27228 KB Output is correct
13 Correct 5 ms 27228 KB Output is correct
14 Correct 5 ms 27228 KB Output is correct
15 Correct 5 ms 27100 KB Output is correct
16 Correct 5 ms 27228 KB Output is correct
17 Correct 5 ms 27224 KB Output is correct
18 Correct 5 ms 27228 KB Output is correct
19 Correct 5 ms 27096 KB Output is correct
20 Correct 5 ms 27228 KB Output is correct
21 Correct 5 ms 27228 KB Output is correct
22 Correct 5 ms 27228 KB Output is correct
23 Correct 5 ms 27100 KB Output is correct
24 Correct 6 ms 27224 KB Output is correct
25 Correct 5 ms 27096 KB Output is correct
26 Correct 5 ms 27224 KB Output is correct
27 Correct 6 ms 27228 KB Output is correct
28 Correct 7 ms 27096 KB Output is correct
29 Correct 5 ms 27228 KB Output is correct
30 Correct 5 ms 27080 KB Output is correct
31 Correct 5 ms 27100 KB Output is correct
32 Correct 5 ms 27228 KB Output is correct
33 Correct 5 ms 27228 KB Output is correct
34 Correct 5 ms 27088 KB Output is correct
35 Correct 5 ms 27228 KB Output is correct
36 Correct 5 ms 27072 KB Output is correct
37 Correct 264 ms 34876 KB Output is correct
38 Correct 232 ms 34640 KB Output is correct
39 Correct 237 ms 34752 KB Output is correct
40 Correct 231 ms 34640 KB Output is correct
41 Correct 245 ms 34760 KB Output is correct
42 Correct 233 ms 34624 KB Output is correct
43 Correct 235 ms 34648 KB Output is correct
44 Correct 237 ms 35264 KB Output is correct
45 Correct 242 ms 34752 KB Output is correct
46 Correct 170 ms 34456 KB Output is correct
47 Correct 236 ms 34752 KB Output is correct
48 Correct 167 ms 34156 KB Output is correct
49 Correct 227 ms 35268 KB Output is correct
50 Correct 175 ms 34496 KB Output is correct
51 Correct 174 ms 34652 KB Output is correct
52 Correct 128 ms 34212 KB Output is correct
53 Correct 164 ms 34612 KB Output is correct
54 Correct 211 ms 34500 KB Output is correct
55 Correct 204 ms 34496 KB Output is correct
56 Correct 123 ms 34500 KB Output is correct
57 Correct 231 ms 34648 KB Output is correct
58 Correct 216 ms 35012 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 27224 KB Output is correct
2 Correct 5 ms 27224 KB Output is correct
3 Correct 5 ms 27100 KB Output is correct
4 Correct 361 ms 39156 KB Output is correct
5 Correct 385 ms 38836 KB Output is correct
6 Correct 372 ms 37816 KB Output is correct
7 Correct 401 ms 38468 KB Output is correct
8 Correct 399 ms 39348 KB Output is correct
9 Correct 399 ms 38592 KB Output is correct
10 Correct 362 ms 38072 KB Output is correct
11 Correct 411 ms 38472 KB Output is correct
12 Correct 453 ms 39236 KB Output is correct
13 Correct 377 ms 39348 KB Output is correct
14 Correct 378 ms 39644 KB Output is correct
15 Correct 360 ms 38228 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 27224 KB Output is correct
2 Correct 5 ms 27224 KB Output is correct
3 Correct 5 ms 27100 KB Output is correct
4 Correct 361 ms 39156 KB Output is correct
5 Correct 385 ms 38836 KB Output is correct
6 Correct 372 ms 37816 KB Output is correct
7 Correct 401 ms 38468 KB Output is correct
8 Correct 399 ms 39348 KB Output is correct
9 Correct 399 ms 38592 KB Output is correct
10 Correct 362 ms 38072 KB Output is correct
11 Correct 411 ms 38472 KB Output is correct
12 Correct 453 ms 39236 KB Output is correct
13 Correct 377 ms 39348 KB Output is correct
14 Correct 378 ms 39644 KB Output is correct
15 Correct 360 ms 38228 KB Output is correct
16 Correct 5 ms 27224 KB Output is correct
17 Correct 426 ms 37828 KB Output is correct
18 Correct 464 ms 38764 KB Output is correct
19 Correct 462 ms 38904 KB Output is correct
20 Correct 458 ms 38264 KB Output is correct
21 Correct 380 ms 38076 KB Output is correct
22 Correct 431 ms 38236 KB Output is correct
23 Correct 379 ms 38076 KB Output is correct
24 Correct 428 ms 38220 KB Output is correct
25 Correct 438 ms 39756 KB Output is correct
26 Correct 407 ms 39492 KB Output is correct
27 Correct 493 ms 38472 KB Output is correct
28 Correct 442 ms 38836 KB Output is correct
29 Correct 458 ms 38332 KB Output is correct
30 Correct 403 ms 38332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 27224 KB Output is correct
2 Correct 5 ms 27224 KB Output is correct
3 Correct 5 ms 27228 KB Output is correct
4 Correct 5 ms 27228 KB Output is correct
5 Correct 6 ms 27224 KB Output is correct
6 Correct 5 ms 27228 KB Output is correct
7 Correct 5 ms 27228 KB Output is correct
8 Correct 5 ms 27068 KB Output is correct
9 Correct 5 ms 27228 KB Output is correct
10 Correct 5 ms 27228 KB Output is correct
11 Correct 5 ms 27228 KB Output is correct
12 Correct 5 ms 27228 KB Output is correct
13 Correct 5 ms 27228 KB Output is correct
14 Correct 5 ms 27228 KB Output is correct
15 Correct 5 ms 27100 KB Output is correct
16 Correct 5 ms 27228 KB Output is correct
17 Correct 5 ms 27224 KB Output is correct
18 Correct 5 ms 27228 KB Output is correct
19 Correct 5 ms 27096 KB Output is correct
20 Correct 5 ms 27228 KB Output is correct
21 Correct 5 ms 27228 KB Output is correct
22 Correct 5 ms 27228 KB Output is correct
23 Correct 5 ms 27100 KB Output is correct
24 Correct 6 ms 27224 KB Output is correct
25 Correct 5 ms 27096 KB Output is correct
26 Correct 5 ms 27224 KB Output is correct
27 Correct 6 ms 27228 KB Output is correct
28 Correct 7 ms 27096 KB Output is correct
29 Correct 5 ms 27228 KB Output is correct
30 Correct 5 ms 27080 KB Output is correct
31 Correct 5 ms 27100 KB Output is correct
32 Correct 5 ms 27228 KB Output is correct
33 Correct 5 ms 27228 KB Output is correct
34 Correct 5 ms 27088 KB Output is correct
35 Correct 5 ms 27228 KB Output is correct
36 Correct 5 ms 27072 KB Output is correct
37 Correct 264 ms 34876 KB Output is correct
38 Correct 232 ms 34640 KB Output is correct
39 Correct 237 ms 34752 KB Output is correct
40 Correct 231 ms 34640 KB Output is correct
41 Correct 245 ms 34760 KB Output is correct
42 Correct 233 ms 34624 KB Output is correct
43 Correct 235 ms 34648 KB Output is correct
44 Correct 237 ms 35264 KB Output is correct
45 Correct 242 ms 34752 KB Output is correct
46 Correct 170 ms 34456 KB Output is correct
47 Correct 236 ms 34752 KB Output is correct
48 Correct 167 ms 34156 KB Output is correct
49 Correct 227 ms 35268 KB Output is correct
50 Correct 175 ms 34496 KB Output is correct
51 Correct 174 ms 34652 KB Output is correct
52 Correct 128 ms 34212 KB Output is correct
53 Correct 164 ms 34612 KB Output is correct
54 Correct 211 ms 34500 KB Output is correct
55 Correct 204 ms 34496 KB Output is correct
56 Correct 123 ms 34500 KB Output is correct
57 Correct 231 ms 34648 KB Output is correct
58 Correct 216 ms 35012 KB Output is correct
59 Correct 5 ms 27224 KB Output is correct
60 Correct 5 ms 27224 KB Output is correct
61 Correct 5 ms 27100 KB Output is correct
62 Correct 361 ms 39156 KB Output is correct
63 Correct 385 ms 38836 KB Output is correct
64 Correct 372 ms 37816 KB Output is correct
65 Correct 401 ms 38468 KB Output is correct
66 Correct 399 ms 39348 KB Output is correct
67 Correct 399 ms 38592 KB Output is correct
68 Correct 362 ms 38072 KB Output is correct
69 Correct 411 ms 38472 KB Output is correct
70 Correct 453 ms 39236 KB Output is correct
71 Correct 377 ms 39348 KB Output is correct
72 Correct 378 ms 39644 KB Output is correct
73 Correct 360 ms 38228 KB Output is correct
74 Correct 5 ms 27224 KB Output is correct
75 Correct 426 ms 37828 KB Output is correct
76 Correct 464 ms 38764 KB Output is correct
77 Correct 462 ms 38904 KB Output is correct
78 Correct 458 ms 38264 KB Output is correct
79 Correct 380 ms 38076 KB Output is correct
80 Correct 431 ms 38236 KB Output is correct
81 Correct 379 ms 38076 KB Output is correct
82 Correct 428 ms 38220 KB Output is correct
83 Correct 438 ms 39756 KB Output is correct
84 Correct 407 ms 39492 KB Output is correct
85 Correct 493 ms 38472 KB Output is correct
86 Correct 442 ms 38836 KB Output is correct
87 Correct 458 ms 38332 KB Output is correct
88 Correct 403 ms 38332 KB Output is correct
89 Correct 446 ms 39636 KB Output is correct
90 Correct 489 ms 38984 KB Output is correct
91 Correct 432 ms 38048 KB Output is correct
92 Correct 476 ms 38840 KB Output is correct
93 Correct 389 ms 39092 KB Output is correct
94 Correct 440 ms 38332 KB Output is correct
95 Correct 404 ms 39208 KB Output is correct
96 Correct 418 ms 38984 KB Output is correct
97 Correct 432 ms 38836 KB Output is correct
98 Correct 429 ms 39624 KB Output is correct
99 Correct 380 ms 38072 KB Output is correct
100 Correct 506 ms 38236 KB Output is correct
101 Correct 458 ms 39500 KB Output is correct
102 Correct 482 ms 39352 KB Output is correct
103 Correct 417 ms 38732 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 27224 KB Output is correct
2 Correct 5 ms 27224 KB Output is correct
3 Correct 5 ms 27228 KB Output is correct
4 Correct 5 ms 27228 KB Output is correct
5 Correct 6 ms 27224 KB Output is correct
6 Correct 5 ms 27228 KB Output is correct
7 Correct 5 ms 27228 KB Output is correct
8 Correct 5 ms 27068 KB Output is correct
9 Correct 5 ms 27228 KB Output is correct
10 Correct 5 ms 27228 KB Output is correct
11 Correct 5 ms 27228 KB Output is correct
12 Correct 5 ms 27228 KB Output is correct
13 Correct 5 ms 27228 KB Output is correct
14 Correct 5 ms 27228 KB Output is correct
15 Correct 5 ms 27100 KB Output is correct
16 Correct 5 ms 27228 KB Output is correct
17 Correct 5 ms 27224 KB Output is correct
18 Correct 5 ms 27228 KB Output is correct
19 Correct 5 ms 27096 KB Output is correct
20 Correct 5 ms 27228 KB Output is correct
21 Correct 5 ms 27228 KB Output is correct
22 Correct 5 ms 27228 KB Output is correct
23 Correct 5 ms 27100 KB Output is correct
24 Correct 6 ms 27224 KB Output is correct
25 Correct 5 ms 27096 KB Output is correct
26 Correct 5 ms 27224 KB Output is correct
27 Correct 6 ms 27228 KB Output is correct
28 Correct 7 ms 27096 KB Output is correct
29 Correct 5 ms 27228 KB Output is correct
30 Correct 5 ms 27080 KB Output is correct
31 Correct 5 ms 27100 KB Output is correct
32 Correct 5 ms 27228 KB Output is correct
33 Correct 5 ms 27228 KB Output is correct
34 Correct 5 ms 27088 KB Output is correct
35 Correct 5 ms 27228 KB Output is correct
36 Correct 5 ms 27072 KB Output is correct
37 Correct 264 ms 34876 KB Output is correct
38 Correct 232 ms 34640 KB Output is correct
39 Correct 237 ms 34752 KB Output is correct
40 Correct 231 ms 34640 KB Output is correct
41 Correct 245 ms 34760 KB Output is correct
42 Correct 233 ms 34624 KB Output is correct
43 Correct 235 ms 34648 KB Output is correct
44 Correct 237 ms 35264 KB Output is correct
45 Correct 242 ms 34752 KB Output is correct
46 Correct 170 ms 34456 KB Output is correct
47 Correct 236 ms 34752 KB Output is correct
48 Correct 167 ms 34156 KB Output is correct
49 Correct 227 ms 35268 KB Output is correct
50 Correct 175 ms 34496 KB Output is correct
51 Correct 174 ms 34652 KB Output is correct
52 Correct 128 ms 34212 KB Output is correct
53 Correct 164 ms 34612 KB Output is correct
54 Correct 211 ms 34500 KB Output is correct
55 Correct 204 ms 34496 KB Output is correct
56 Correct 123 ms 34500 KB Output is correct
57 Correct 231 ms 34648 KB Output is correct
58 Correct 216 ms 35012 KB Output is correct
59 Correct 5 ms 27224 KB Output is correct
60 Correct 5 ms 27224 KB Output is correct
61 Correct 5 ms 27100 KB Output is correct
62 Correct 361 ms 39156 KB Output is correct
63 Correct 385 ms 38836 KB Output is correct
64 Correct 372 ms 37816 KB Output is correct
65 Correct 401 ms 38468 KB Output is correct
66 Correct 399 ms 39348 KB Output is correct
67 Correct 399 ms 38592 KB Output is correct
68 Correct 362 ms 38072 KB Output is correct
69 Correct 411 ms 38472 KB Output is correct
70 Correct 453 ms 39236 KB Output is correct
71 Correct 377 ms 39348 KB Output is correct
72 Correct 378 ms 39644 KB Output is correct
73 Correct 360 ms 38228 KB Output is correct
74 Correct 5 ms 27224 KB Output is correct
75 Correct 426 ms 37828 KB Output is correct
76 Correct 464 ms 38764 KB Output is correct
77 Correct 462 ms 38904 KB Output is correct
78 Correct 458 ms 38264 KB Output is correct
79 Correct 380 ms 38076 KB Output is correct
80 Correct 431 ms 38236 KB Output is correct
81 Correct 379 ms 38076 KB Output is correct
82 Correct 428 ms 38220 KB Output is correct
83 Correct 438 ms 39756 KB Output is correct
84 Correct 407 ms 39492 KB Output is correct
85 Correct 493 ms 38472 KB Output is correct
86 Correct 442 ms 38836 KB Output is correct
87 Correct 458 ms 38332 KB Output is correct
88 Correct 403 ms 38332 KB Output is correct
89 Correct 446 ms 39636 KB Output is correct
90 Correct 489 ms 38984 KB Output is correct
91 Correct 432 ms 38048 KB Output is correct
92 Correct 476 ms 38840 KB Output is correct
93 Correct 389 ms 39092 KB Output is correct
94 Correct 440 ms 38332 KB Output is correct
95 Correct 404 ms 39208 KB Output is correct
96 Correct 418 ms 38984 KB Output is correct
97 Correct 432 ms 38836 KB Output is correct
98 Correct 429 ms 39624 KB Output is correct
99 Correct 380 ms 38072 KB Output is correct
100 Correct 506 ms 38236 KB Output is correct
101 Correct 458 ms 39500 KB Output is correct
102 Correct 482 ms 39352 KB Output is correct
103 Correct 417 ms 38732 KB Output is correct
104 Correct 1459 ms 55636 KB Output is correct
105 Correct 1544 ms 63876 KB Output is correct
106 Correct 1212 ms 55308 KB Output is correct
107 Correct 1489 ms 63364 KB Output is correct
108 Correct 1000 ms 56396 KB Output is correct
109 Correct 1205 ms 63168 KB Output is correct
110 Correct 1020 ms 64180 KB Output is correct
111 Correct 1122 ms 62908 KB Output is correct
112 Correct 1377 ms 63196 KB Output is correct
113 Correct 1306 ms 61840 KB Output is correct
114 Correct 885 ms 62396 KB Output is correct
115 Correct 1555 ms 62420 KB Output is correct
116 Correct 1463 ms 62868 KB Output is correct
117 Correct 894 ms 63572 KB Output is correct
118 Correct 891 ms 62420 KB Output is correct