Submission #973120

# Submission time Handle Problem Language Result Execution time Memory
973120 2024-05-01T13:54:29 Z aykhn Food Court (JOI21_foodcourt) C++17
100 / 100
513 ms 70508 KB
#include <bits/stdc++.h>

using namespace std;

#define int long long

struct SegTree
{
    int sz = 1;
    vector<array<int, 2>> st;
    void init(int n)
    {
        sz = 1;
        while (sz < n) sz <<= 1;
        st.assign(sz << 1, {0, 0});
    }
    array<int, 2> combine(array<int, 2> x, array<int, 2> y)
    {
        int mn = min(x[0], y[1]);
        x[0] -= mn, y[1] -= mn;
        x[0] += y[0], x[1] += y[1];
        return x;
    }
    void make(int l, int r, int x, int ind, int val, int t)
    {
        if (l + 1 == r)
        {
            st[x][t] = val;
            return;
        }
        int mid = (l + r) >> 1;
        if (ind < mid) make(l, mid, 2*x + 1, ind, val, t);
        else make(mid, r, 2*x + 2, ind, val, t);
        st[x] = combine(st[2*x + 1], st[2*x + 2]);
    }
    array<int, 2> get(int l, int r, int x, int lx, int rx)
    {
        if (l >= rx || r <= lx) return {0, 0};
        if (l >= lx && r <= rx) return st[x];
        int mid = (l + r) >> 1;
        return combine(get(l, mid, 2*x + 1, lx, rx), get(mid, r, 2*x + 2, lx, rx));
    }
};

struct SegTreeSUM
{
    int sz = 1;
    vector<int> st;
    void init(int n)
    {
        sz = 1;
        while (sz < n) sz <<= 1;
        st.assign(sz << 1, 0);
    }
    int combine(int x, int y)
    {
        return x + y;
    }
    void make(int l, int r, int x, int ind, int val)
    {
        if (l + 1 == r)
        {
            st[x] = val;
            return;
        }
        int mid = (l + r) >> 1;
        if (ind < mid) make(l, mid, 2*x + 1, ind, val);
        else make(mid, r, 2*x + 2, ind, val);
        st[x] = combine(st[2*x + 1], st[2*x + 2]);
    }
    int get(int l, int r, int x, int lx, int rx)
    {
        if (l >= rx || r <= lx) return 0;
        if (l >= lx && r <= rx) return st[x];
        int mid = (l + r) >> 1;
        return combine(get(l, mid, 2*x + 1, lx, rx), get(mid, r, 2*x + 2, lx, rx));
    }
    int findval(int l, int r, int x, int lx, int rx, int val)
    {
        if (l >= rx || r <= lx || st[x] < val) return -1;
        if (l + 1 == r) return l;
        int mid = (l + r) >> 1;
        int A = findval(l, mid, 2*x + 1, lx, rx, val);
        if (A != -1) return A;
        return findval(mid, r, 2*x + 2, lx, rx, val - st[2*x + 1]);
    }
};

const int MXN = 25e4 + 5;

int n, m, Q;
vector<int> q[MXN];
vector<int> add[MXN], del[MXN], here[MXN];
int ans[MXN];

signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> m >> Q;
    for (int i = 0; i < Q; i++)
    {
        int k;
        cin >> k;
        if (k == 1) k = 4;
        else if (k == 2) k = 3;
        else if (k == 3) k = 2;
        q[i].resize(k);
        for (int &j : q[i]) cin >> j;
        if (k == 4) swap(q[i][2], q[i][3]);
        if (k >= 3)
        {
            add[q[i][0]].push_back(i);
            del[q[i][1] + 1].push_back(i);
        }
        else here[q[i][0]].push_back(i);
    }
    SegTree st;
    SegTreeSUM st1, st2;
    st.init(Q), st1.init(Q), st2.init(Q);
    int sz = st.sz;
    for (int i = 1; i <= n; i++)
    {
        for (int &j : add[i])
        {
            if (q[j].size() == 4) 
            {
                st.make(0, sz, 0, j, q[j][2], 0);
                st1.make(0, sz, 0, j, q[j][2]);
            }
            else 
            {
                st.make(0, sz, 0, j, q[j][2], 1);
                st2.make(0, sz, 0, j, q[j][2]);
            }
        }
        for (int &j : del[i])
        {
            if (q[j].size() == 4) 
            {
                st.make(0, sz, 0, j, 0, 0);
                st1.make(0, sz, 0, j, 0);
            }
            else 
            {
                st.make(0, sz, 0, j, 0, 1);
                st2.make(0, sz, 0, j, 0);
            }
        }
        for (int &j : here[i])
        {
            array<int, 2> x = st.get(0, sz, 0, 0, j);
            int k = st2.get(0, sz, 0, 0, j);
            k -= x[1];
            int ff = k + q[j][1];
            int res = st1.findval(0, sz, 0, 0, j, ff);
            if (res == -1) ans[j] = 0;
            else ans[j] = q[res][3];
        }
    }
    for (int i = 0; i < Q; i++)
    {
        if (q[i].size() == 2) cout << ans[i] << '\n';
    }
}
# Verdict Execution time Memory Grader output
1 Correct 11 ms 25948 KB Output is correct
2 Correct 7 ms 25948 KB Output is correct
3 Correct 7 ms 25948 KB Output is correct
4 Correct 8 ms 26316 KB Output is correct
5 Correct 7 ms 25992 KB Output is correct
6 Correct 7 ms 25948 KB Output is correct
7 Correct 9 ms 26068 KB Output is correct
8 Correct 8 ms 25948 KB Output is correct
9 Correct 8 ms 25944 KB Output is correct
10 Correct 9 ms 26004 KB Output is correct
11 Correct 7 ms 25948 KB Output is correct
12 Correct 7 ms 25944 KB Output is correct
13 Correct 7 ms 25948 KB Output is correct
14 Correct 7 ms 25944 KB Output is correct
15 Correct 7 ms 25948 KB Output is correct
16 Correct 8 ms 25948 KB Output is correct
17 Correct 8 ms 25948 KB Output is correct
18 Correct 10 ms 26016 KB Output is correct
19 Correct 8 ms 26060 KB Output is correct
20 Correct 8 ms 25948 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 25948 KB Output is correct
2 Correct 7 ms 25948 KB Output is correct
3 Correct 7 ms 25948 KB Output is correct
4 Correct 8 ms 26316 KB Output is correct
5 Correct 7 ms 25992 KB Output is correct
6 Correct 7 ms 25948 KB Output is correct
7 Correct 9 ms 26068 KB Output is correct
8 Correct 8 ms 25948 KB Output is correct
9 Correct 8 ms 25944 KB Output is correct
10 Correct 9 ms 26004 KB Output is correct
11 Correct 7 ms 25948 KB Output is correct
12 Correct 7 ms 25944 KB Output is correct
13 Correct 7 ms 25948 KB Output is correct
14 Correct 7 ms 25944 KB Output is correct
15 Correct 7 ms 25948 KB Output is correct
16 Correct 8 ms 25948 KB Output is correct
17 Correct 8 ms 25948 KB Output is correct
18 Correct 10 ms 26016 KB Output is correct
19 Correct 8 ms 26060 KB Output is correct
20 Correct 8 ms 25948 KB Output is correct
21 Correct 8 ms 25948 KB Output is correct
22 Correct 7 ms 25948 KB Output is correct
23 Correct 8 ms 25948 KB Output is correct
24 Correct 9 ms 25948 KB Output is correct
25 Correct 7 ms 25948 KB Output is correct
26 Correct 7 ms 25948 KB Output is correct
27 Correct 8 ms 26008 KB Output is correct
28 Correct 9 ms 25944 KB Output is correct
29 Correct 10 ms 26072 KB Output is correct
30 Correct 17 ms 25944 KB Output is correct
31 Correct 7 ms 26200 KB Output is correct
32 Correct 7 ms 26004 KB Output is correct
33 Correct 8 ms 25948 KB Output is correct
34 Correct 7 ms 25952 KB Output is correct
35 Correct 8 ms 25948 KB Output is correct
36 Correct 8 ms 26200 KB Output is correct
37 Correct 7 ms 25944 KB Output is correct
38 Correct 8 ms 25948 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 77 ms 36180 KB Output is correct
2 Correct 92 ms 36492 KB Output is correct
3 Correct 88 ms 36180 KB Output is correct
4 Correct 71 ms 36168 KB Output is correct
5 Correct 73 ms 36432 KB Output is correct
6 Correct 70 ms 36372 KB Output is correct
7 Correct 34 ms 33600 KB Output is correct
8 Correct 42 ms 34116 KB Output is correct
9 Correct 75 ms 36280 KB Output is correct
10 Correct 79 ms 36244 KB Output is correct
11 Correct 76 ms 36176 KB Output is correct
12 Correct 75 ms 36432 KB Output is correct
13 Correct 61 ms 35416 KB Output is correct
14 Correct 81 ms 36272 KB Output is correct
15 Correct 69 ms 36432 KB Output is correct
16 Correct 78 ms 36692 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 399 ms 65108 KB Output is correct
2 Correct 347 ms 60400 KB Output is correct
3 Correct 455 ms 67156 KB Output is correct
4 Correct 320 ms 61180 KB Output is correct
5 Correct 333 ms 61204 KB Output is correct
6 Correct 464 ms 67924 KB Output is correct
7 Correct 131 ms 58924 KB Output is correct
8 Correct 145 ms 58936 KB Output is correct
9 Correct 431 ms 67156 KB Output is correct
10 Correct 410 ms 67168 KB Output is correct
11 Correct 447 ms 67168 KB Output is correct
12 Correct 449 ms 67248 KB Output is correct
13 Correct 446 ms 66996 KB Output is correct
14 Correct 453 ms 67100 KB Output is correct
15 Correct 434 ms 66896 KB Output is correct
16 Correct 439 ms 66900 KB Output is correct
17 Correct 486 ms 66920 KB Output is correct
18 Correct 434 ms 66896 KB Output is correct
19 Correct 445 ms 67096 KB Output is correct
20 Correct 465 ms 66976 KB Output is correct
21 Correct 460 ms 66836 KB Output is correct
22 Correct 439 ms 66900 KB Output is correct
23 Correct 464 ms 66948 KB Output is correct
24 Correct 468 ms 66972 KB Output is correct
25 Correct 385 ms 63032 KB Output is correct
26 Correct 370 ms 63532 KB Output is correct
27 Correct 336 ms 69956 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 25948 KB Output is correct
2 Correct 7 ms 25948 KB Output is correct
3 Correct 7 ms 25948 KB Output is correct
4 Correct 8 ms 26316 KB Output is correct
5 Correct 7 ms 25992 KB Output is correct
6 Correct 7 ms 25948 KB Output is correct
7 Correct 9 ms 26068 KB Output is correct
8 Correct 8 ms 25948 KB Output is correct
9 Correct 8 ms 25944 KB Output is correct
10 Correct 9 ms 26004 KB Output is correct
11 Correct 7 ms 25948 KB Output is correct
12 Correct 7 ms 25944 KB Output is correct
13 Correct 7 ms 25948 KB Output is correct
14 Correct 7 ms 25944 KB Output is correct
15 Correct 7 ms 25948 KB Output is correct
16 Correct 8 ms 25948 KB Output is correct
17 Correct 8 ms 25948 KB Output is correct
18 Correct 10 ms 26016 KB Output is correct
19 Correct 8 ms 26060 KB Output is correct
20 Correct 8 ms 25948 KB Output is correct
21 Correct 77 ms 36180 KB Output is correct
22 Correct 92 ms 36492 KB Output is correct
23 Correct 88 ms 36180 KB Output is correct
24 Correct 71 ms 36168 KB Output is correct
25 Correct 73 ms 36432 KB Output is correct
26 Correct 70 ms 36372 KB Output is correct
27 Correct 34 ms 33600 KB Output is correct
28 Correct 42 ms 34116 KB Output is correct
29 Correct 75 ms 36280 KB Output is correct
30 Correct 79 ms 36244 KB Output is correct
31 Correct 76 ms 36176 KB Output is correct
32 Correct 75 ms 36432 KB Output is correct
33 Correct 61 ms 35416 KB Output is correct
34 Correct 81 ms 36272 KB Output is correct
35 Correct 69 ms 36432 KB Output is correct
36 Correct 78 ms 36692 KB Output is correct
37 Correct 108 ms 35156 KB Output is correct
38 Correct 65 ms 34900 KB Output is correct
39 Correct 32 ms 33292 KB Output is correct
40 Correct 35 ms 33640 KB Output is correct
41 Correct 79 ms 35920 KB Output is correct
42 Correct 70 ms 35932 KB Output is correct
43 Correct 74 ms 35864 KB Output is correct
44 Correct 74 ms 35924 KB Output is correct
45 Correct 91 ms 35804 KB Output is correct
46 Correct 80 ms 35924 KB Output is correct
47 Correct 44 ms 34528 KB Output is correct
48 Correct 62 ms 34888 KB Output is correct
49 Correct 64 ms 34252 KB Output is correct
50 Correct 61 ms 35180 KB Output is correct
51 Correct 93 ms 36180 KB Output is correct
52 Correct 72 ms 35928 KB Output is correct
53 Correct 56 ms 35408 KB Output is correct
54 Correct 71 ms 36792 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 64 ms 35920 KB Output is correct
2 Correct 78 ms 36416 KB Output is correct
3 Correct 83 ms 36944 KB Output is correct
4 Correct 51 ms 34644 KB Output is correct
5 Correct 78 ms 35600 KB Output is correct
6 Correct 76 ms 36432 KB Output is correct
7 Correct 38 ms 33988 KB Output is correct
8 Correct 36 ms 33748 KB Output is correct
9 Correct 51 ms 35404 KB Output is correct
10 Correct 46 ms 34108 KB Output is correct
11 Correct 63 ms 35664 KB Output is correct
12 Correct 67 ms 35612 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 25948 KB Output is correct
2 Correct 7 ms 25948 KB Output is correct
3 Correct 7 ms 25948 KB Output is correct
4 Correct 8 ms 26316 KB Output is correct
5 Correct 7 ms 25992 KB Output is correct
6 Correct 7 ms 25948 KB Output is correct
7 Correct 9 ms 26068 KB Output is correct
8 Correct 8 ms 25948 KB Output is correct
9 Correct 8 ms 25944 KB Output is correct
10 Correct 9 ms 26004 KB Output is correct
11 Correct 7 ms 25948 KB Output is correct
12 Correct 7 ms 25944 KB Output is correct
13 Correct 7 ms 25948 KB Output is correct
14 Correct 7 ms 25944 KB Output is correct
15 Correct 7 ms 25948 KB Output is correct
16 Correct 8 ms 25948 KB Output is correct
17 Correct 8 ms 25948 KB Output is correct
18 Correct 10 ms 26016 KB Output is correct
19 Correct 8 ms 26060 KB Output is correct
20 Correct 8 ms 25948 KB Output is correct
21 Correct 8 ms 25948 KB Output is correct
22 Correct 7 ms 25948 KB Output is correct
23 Correct 8 ms 25948 KB Output is correct
24 Correct 9 ms 25948 KB Output is correct
25 Correct 7 ms 25948 KB Output is correct
26 Correct 7 ms 25948 KB Output is correct
27 Correct 8 ms 26008 KB Output is correct
28 Correct 9 ms 25944 KB Output is correct
29 Correct 10 ms 26072 KB Output is correct
30 Correct 17 ms 25944 KB Output is correct
31 Correct 7 ms 26200 KB Output is correct
32 Correct 7 ms 26004 KB Output is correct
33 Correct 8 ms 25948 KB Output is correct
34 Correct 7 ms 25952 KB Output is correct
35 Correct 8 ms 25948 KB Output is correct
36 Correct 8 ms 26200 KB Output is correct
37 Correct 7 ms 25944 KB Output is correct
38 Correct 8 ms 25948 KB Output is correct
39 Correct 77 ms 36180 KB Output is correct
40 Correct 92 ms 36492 KB Output is correct
41 Correct 88 ms 36180 KB Output is correct
42 Correct 71 ms 36168 KB Output is correct
43 Correct 73 ms 36432 KB Output is correct
44 Correct 70 ms 36372 KB Output is correct
45 Correct 34 ms 33600 KB Output is correct
46 Correct 42 ms 34116 KB Output is correct
47 Correct 75 ms 36280 KB Output is correct
48 Correct 79 ms 36244 KB Output is correct
49 Correct 76 ms 36176 KB Output is correct
50 Correct 75 ms 36432 KB Output is correct
51 Correct 61 ms 35416 KB Output is correct
52 Correct 81 ms 36272 KB Output is correct
53 Correct 69 ms 36432 KB Output is correct
54 Correct 78 ms 36692 KB Output is correct
55 Correct 108 ms 35156 KB Output is correct
56 Correct 65 ms 34900 KB Output is correct
57 Correct 32 ms 33292 KB Output is correct
58 Correct 35 ms 33640 KB Output is correct
59 Correct 79 ms 35920 KB Output is correct
60 Correct 70 ms 35932 KB Output is correct
61 Correct 74 ms 35864 KB Output is correct
62 Correct 74 ms 35924 KB Output is correct
63 Correct 91 ms 35804 KB Output is correct
64 Correct 80 ms 35924 KB Output is correct
65 Correct 44 ms 34528 KB Output is correct
66 Correct 62 ms 34888 KB Output is correct
67 Correct 64 ms 34252 KB Output is correct
68 Correct 61 ms 35180 KB Output is correct
69 Correct 93 ms 36180 KB Output is correct
70 Correct 72 ms 35928 KB Output is correct
71 Correct 56 ms 35408 KB Output is correct
72 Correct 71 ms 36792 KB Output is correct
73 Correct 64 ms 35920 KB Output is correct
74 Correct 78 ms 36416 KB Output is correct
75 Correct 83 ms 36944 KB Output is correct
76 Correct 51 ms 34644 KB Output is correct
77 Correct 78 ms 35600 KB Output is correct
78 Correct 76 ms 36432 KB Output is correct
79 Correct 38 ms 33988 KB Output is correct
80 Correct 36 ms 33748 KB Output is correct
81 Correct 51 ms 35404 KB Output is correct
82 Correct 46 ms 34108 KB Output is correct
83 Correct 63 ms 35664 KB Output is correct
84 Correct 67 ms 35612 KB Output is correct
85 Correct 85 ms 35880 KB Output is correct
86 Correct 79 ms 36444 KB Output is correct
87 Correct 68 ms 35924 KB Output is correct
88 Correct 74 ms 36692 KB Output is correct
89 Correct 52 ms 34396 KB Output is correct
90 Correct 74 ms 36444 KB Output is correct
91 Correct 69 ms 35216 KB Output is correct
92 Correct 64 ms 34956 KB Output is correct
93 Correct 84 ms 36348 KB Output is correct
94 Correct 96 ms 36448 KB Output is correct
95 Correct 78 ms 36176 KB Output is correct
96 Correct 75 ms 36432 KB Output is correct
97 Correct 85 ms 36424 KB Output is correct
98 Correct 62 ms 35408 KB Output is correct
99 Correct 60 ms 35040 KB Output is correct
100 Correct 54 ms 34472 KB Output is correct
101 Correct 60 ms 35408 KB Output is correct
102 Correct 77 ms 36948 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 25948 KB Output is correct
2 Correct 7 ms 25948 KB Output is correct
3 Correct 7 ms 25948 KB Output is correct
4 Correct 8 ms 26316 KB Output is correct
5 Correct 7 ms 25992 KB Output is correct
6 Correct 7 ms 25948 KB Output is correct
7 Correct 9 ms 26068 KB Output is correct
8 Correct 8 ms 25948 KB Output is correct
9 Correct 8 ms 25944 KB Output is correct
10 Correct 9 ms 26004 KB Output is correct
11 Correct 7 ms 25948 KB Output is correct
12 Correct 7 ms 25944 KB Output is correct
13 Correct 7 ms 25948 KB Output is correct
14 Correct 7 ms 25944 KB Output is correct
15 Correct 7 ms 25948 KB Output is correct
16 Correct 8 ms 25948 KB Output is correct
17 Correct 8 ms 25948 KB Output is correct
18 Correct 10 ms 26016 KB Output is correct
19 Correct 8 ms 26060 KB Output is correct
20 Correct 8 ms 25948 KB Output is correct
21 Correct 8 ms 25948 KB Output is correct
22 Correct 7 ms 25948 KB Output is correct
23 Correct 8 ms 25948 KB Output is correct
24 Correct 9 ms 25948 KB Output is correct
25 Correct 7 ms 25948 KB Output is correct
26 Correct 7 ms 25948 KB Output is correct
27 Correct 8 ms 26008 KB Output is correct
28 Correct 9 ms 25944 KB Output is correct
29 Correct 10 ms 26072 KB Output is correct
30 Correct 17 ms 25944 KB Output is correct
31 Correct 7 ms 26200 KB Output is correct
32 Correct 7 ms 26004 KB Output is correct
33 Correct 8 ms 25948 KB Output is correct
34 Correct 7 ms 25952 KB Output is correct
35 Correct 8 ms 25948 KB Output is correct
36 Correct 8 ms 26200 KB Output is correct
37 Correct 7 ms 25944 KB Output is correct
38 Correct 8 ms 25948 KB Output is correct
39 Correct 77 ms 36180 KB Output is correct
40 Correct 92 ms 36492 KB Output is correct
41 Correct 88 ms 36180 KB Output is correct
42 Correct 71 ms 36168 KB Output is correct
43 Correct 73 ms 36432 KB Output is correct
44 Correct 70 ms 36372 KB Output is correct
45 Correct 34 ms 33600 KB Output is correct
46 Correct 42 ms 34116 KB Output is correct
47 Correct 75 ms 36280 KB Output is correct
48 Correct 79 ms 36244 KB Output is correct
49 Correct 76 ms 36176 KB Output is correct
50 Correct 75 ms 36432 KB Output is correct
51 Correct 61 ms 35416 KB Output is correct
52 Correct 81 ms 36272 KB Output is correct
53 Correct 69 ms 36432 KB Output is correct
54 Correct 78 ms 36692 KB Output is correct
55 Correct 399 ms 65108 KB Output is correct
56 Correct 347 ms 60400 KB Output is correct
57 Correct 455 ms 67156 KB Output is correct
58 Correct 320 ms 61180 KB Output is correct
59 Correct 333 ms 61204 KB Output is correct
60 Correct 464 ms 67924 KB Output is correct
61 Correct 131 ms 58924 KB Output is correct
62 Correct 145 ms 58936 KB Output is correct
63 Correct 431 ms 67156 KB Output is correct
64 Correct 410 ms 67168 KB Output is correct
65 Correct 447 ms 67168 KB Output is correct
66 Correct 449 ms 67248 KB Output is correct
67 Correct 446 ms 66996 KB Output is correct
68 Correct 453 ms 67100 KB Output is correct
69 Correct 434 ms 66896 KB Output is correct
70 Correct 439 ms 66900 KB Output is correct
71 Correct 486 ms 66920 KB Output is correct
72 Correct 434 ms 66896 KB Output is correct
73 Correct 445 ms 67096 KB Output is correct
74 Correct 465 ms 66976 KB Output is correct
75 Correct 460 ms 66836 KB Output is correct
76 Correct 439 ms 66900 KB Output is correct
77 Correct 464 ms 66948 KB Output is correct
78 Correct 468 ms 66972 KB Output is correct
79 Correct 385 ms 63032 KB Output is correct
80 Correct 370 ms 63532 KB Output is correct
81 Correct 336 ms 69956 KB Output is correct
82 Correct 108 ms 35156 KB Output is correct
83 Correct 65 ms 34900 KB Output is correct
84 Correct 32 ms 33292 KB Output is correct
85 Correct 35 ms 33640 KB Output is correct
86 Correct 79 ms 35920 KB Output is correct
87 Correct 70 ms 35932 KB Output is correct
88 Correct 74 ms 35864 KB Output is correct
89 Correct 74 ms 35924 KB Output is correct
90 Correct 91 ms 35804 KB Output is correct
91 Correct 80 ms 35924 KB Output is correct
92 Correct 44 ms 34528 KB Output is correct
93 Correct 62 ms 34888 KB Output is correct
94 Correct 64 ms 34252 KB Output is correct
95 Correct 61 ms 35180 KB Output is correct
96 Correct 93 ms 36180 KB Output is correct
97 Correct 72 ms 35928 KB Output is correct
98 Correct 56 ms 35408 KB Output is correct
99 Correct 71 ms 36792 KB Output is correct
100 Correct 64 ms 35920 KB Output is correct
101 Correct 78 ms 36416 KB Output is correct
102 Correct 83 ms 36944 KB Output is correct
103 Correct 51 ms 34644 KB Output is correct
104 Correct 78 ms 35600 KB Output is correct
105 Correct 76 ms 36432 KB Output is correct
106 Correct 38 ms 33988 KB Output is correct
107 Correct 36 ms 33748 KB Output is correct
108 Correct 51 ms 35404 KB Output is correct
109 Correct 46 ms 34108 KB Output is correct
110 Correct 63 ms 35664 KB Output is correct
111 Correct 67 ms 35612 KB Output is correct
112 Correct 85 ms 35880 KB Output is correct
113 Correct 79 ms 36444 KB Output is correct
114 Correct 68 ms 35924 KB Output is correct
115 Correct 74 ms 36692 KB Output is correct
116 Correct 52 ms 34396 KB Output is correct
117 Correct 74 ms 36444 KB Output is correct
118 Correct 69 ms 35216 KB Output is correct
119 Correct 64 ms 34956 KB Output is correct
120 Correct 84 ms 36348 KB Output is correct
121 Correct 96 ms 36448 KB Output is correct
122 Correct 78 ms 36176 KB Output is correct
123 Correct 75 ms 36432 KB Output is correct
124 Correct 85 ms 36424 KB Output is correct
125 Correct 62 ms 35408 KB Output is correct
126 Correct 60 ms 35040 KB Output is correct
127 Correct 54 ms 34472 KB Output is correct
128 Correct 60 ms 35408 KB Output is correct
129 Correct 77 ms 36948 KB Output is correct
130 Correct 496 ms 67580 KB Output is correct
131 Correct 303 ms 60612 KB Output is correct
132 Correct 505 ms 67684 KB Output is correct
133 Correct 457 ms 67444 KB Output is correct
134 Correct 395 ms 64816 KB Output is correct
135 Correct 513 ms 68816 KB Output is correct
136 Correct 432 ms 67920 KB Output is correct
137 Correct 431 ms 68068 KB Output is correct
138 Correct 479 ms 67768 KB Output is correct
139 Correct 449 ms 67612 KB Output is correct
140 Correct 441 ms 67788 KB Output is correct
141 Correct 513 ms 67656 KB Output is correct
142 Correct 453 ms 67624 KB Output is correct
143 Correct 485 ms 67672 KB Output is correct
144 Correct 436 ms 67668 KB Output is correct
145 Correct 467 ms 67672 KB Output is correct
146 Correct 449 ms 67668 KB Output is correct
147 Correct 437 ms 67600 KB Output is correct
148 Correct 480 ms 67796 KB Output is correct
149 Correct 480 ms 67472 KB Output is correct
150 Correct 216 ms 62192 KB Output is correct
151 Correct 367 ms 64176 KB Output is correct
152 Correct 401 ms 64408 KB Output is correct
153 Correct 371 ms 70508 KB Output is correct