Submission #601010

# Submission time Handle Problem Language Result Execution time Memory
601010 2022-07-21T10:06:10 Z KoD Fish 2 (JOI22_fish2) C++17
100 / 100
711 ms 18244 KB
#include <bits/stdc++.h>
 
using ll = long long;
using std::pair;
using std::vector;
 
class Sequence {
    struct Data {
        int max;
        ll sum;
        static Data identity() {
            return {0, 0};
        }
        static Data make(const int x) {
            return {x, x};
        }
        friend Data operator+(const Data& l, const Data& r) {
            return {std::max(l.max, r.max), l.sum + r.sum};
        }
    };
 
    int size, logn;
    vector<Data> data;
 
  public:
    explicit Sequence(const vector<int>& vec) {
        logn = 0;
        while ((1 << logn) < (int)vec.size()) {
            logn += 1;
        }
        size = 1 << logn;
        data.resize(2 * size, Data::identity());
        for (int i = 0; i < (int)vec.size(); ++i) {
            data[size + i] = Data::make(vec[i]);
        }
        for (int i = size - 1; i > 0; --i) {
            data[i] = data[2 * i] + data[2 * i + 1];
        }
    }
 
    void update(int i, const int x) {
        i += size;
        data[i] = Data::make(x);
        while (i > 1) {
            i >>= 1;
            data[i] = data[2 * i] + data[2 * i + 1];
        }
    }
 
    ll sum(int l, int r) const {
        l += size;
        r += size;
        ll ret = 0;
        while (l < r) {
            if (l & 1) {
                ret += data[l].sum;
                l += 1;
            }
            if (r & 1) {
                r -= 1;
                ret += data[r].sum;
            }
            l >>= 1;
            r >>= 1;
        }
        return ret;
    }
 
    int upb_to_right(int l, const ll x) {
        if (l == size) return -1;
        l += size;
        do {
            while (!(l & 1)) l >>= 1;
            if (data[l].max > x) {
                while (l < size) {
                    l <<= 1;
                    if (data[l].max <= x) {
                        l += 1;
                    }
                }
                return l - size;
            }
            l >>= 1;
            l += 1;
        } while (l & (l - 1));
        return -1;
    }
 
    int upb_to_left(int r, const ll x) {
        if (r == 0) return -1;
        r += size;
        do {
            while (!(r & 1)) r >>= 1;
            r -= 1;
            if (data[r].max > x) {
                while (r < size) {
                    r <<= 1;
                    if (data[r + 1].max > x) {
                        r += 1;
                    }
                }
                return r - size;
            }
            r >>= 1;
        } while (r & (r - 1));
        return -1;
    }
};
 
class Intervals {
    int size, logn;
    vector<vector<pair<int, int>>> data;
 
  public:
    explicit Intervals(const int n) {
        logn = 0;
        while ((1 << logn) < n) {
            logn += 1;
        }
        size = 1 << logn;
        data.resize(2 * size);
    }
  
    void add(const int l, const int r) {
        int i = l + size, j = l + 1, k = 1;
        while (j < r) {
            if (!(i & 1)) {
                j += k;
            }
            i >>= 1;
            k <<= 1;
        }
        data[i].emplace_back(l, r);
    }
 
    template <class F>
    void pop(const int k, const F& f) {
        int i = k + size;
        while (i > 0) {
            auto& vec = data[i];
            for (int i = 0; i < (int)vec.size();) {
                const auto& [l, r] = vec[i];
                if (l <= k and k < r) {
                    f(l, r);
                    std::swap(vec[i], vec.back());
                    vec.pop_back();
                } else {
                    i += 1;
                }
            }
            i >>= 1;
        }
    }
};
 
class SegmentTree {
    struct Data {
        int min, cnt;
        static Data identity() {
            return {1000000000, 0};
        }
        static Data make(const int x) {
            return {x, 1};
        }
        friend Data operator+(const Data& l, const Data& r) {
            const int m = std::min(l.min, r.min);
            return {m, (l.min == m ? l.cnt : 0) + (r.min == m ? r.cnt : 0)};
        }
    };
 
    int size, logn;
    vector<Data> data;
    vector<int> add;
 
    void apply(const int k, const int a) {
        data[k].min += a;
        if (k < size) {
            add[k] += a;
        }
    }
    void flush(const int k) {
        if (add[k] != 0) {
            apply(2 * k, add[k]);
            apply(2 * k + 1, add[k]);
            add[k] = 0;
        }
    }
    void push(const int k) {
        const int lsb = __builtin_ctz(k);
        for (int d = logn; d > lsb; --d) {
            flush(k >> d);
        }
    }
 
    void fetch(const int k) {
        data[k] = data[2 * k] + data[2 * k + 1];
    }
    void pull(int k) {
        k >>= __builtin_ctz(k);
        while (k > 1) {
            fetch(k >>= 1);
        }
    }
 
  public:
    explicit SegmentTree(const int n) {
        logn = 0;
        while ((1 << logn) < n) {
            logn += 1;
        }
        size = 1 << logn;
        data.resize(2 * size, Data::identity());
        for (int i = 0; i < n; ++i) {
            data[size + i] = Data::make(0);
        }
        for (int i = size - 1; i > 0; --i) {
            data[i] = data[2 * i] + data[2 * i + 1];
        }
        add.resize(size);
    }
 
    void operate(int l, int r, const int x) {
        l += size;
        r += size;
        push(l);
        push(r);
        const int lc = l, rc = r;
        while (l < r) {
            if (l & 1) {
                apply(l, x);
                l += 1;
            }
            if (r & 1) {
                r -= 1;
                apply(r, x);
            }
            l >>= 1;
            r >>= 1;
        }
        pull(lc);
        pull(rc);
    }
 
    int fold(int l, int r) {
        l += size;
        r += size;
        push(l);
        push(r);
        Data ret = Data::identity();
        while (l < r) {
            if (l & 1) {
                ret = ret + data[l];
                l += 1;
            }
            if (r & 1) {
                r -= 1;
                ret = data[r] + ret;
            }
            l >>= 1;
            r >>= 1;
        }
        return ret.cnt;
    }
};
 
int main() {
    int N;
    std::cin >> N;
    vector<int> A(N);
    for (auto& x : A) {
        std::cin >> x;
    }
    Sequence seq(A);
    Intervals range(N);
    SegmentTree seg(N);
    const auto insert = [&](int l, int r) {
        if (l + 1 < r) {
            seg.operate(l + 1, r, 1);
            range.add(l, r + 1);
        }
    };
    const auto erase = [&](const int l, const int r) {
        seg.operate(l + 1, r - 1, -1);
    };
    {
        vector<ll> accum(N + 1);
        for (int i = 0; i < N; ++i) {
            accum[i + 1] = accum[i] + A[i];
        }
        vector<int> stack;
        const auto test = [&](const int l, const int r) {
            if (std::min(A[l], A[r]) > accum[r] - accum[l + 1]) {
                insert(l, r);
            }
        };
        for (int i = 0; i < N; ++i) {
            while (!stack.empty() and A[stack.back()] < A[i]) {
                test(stack.back(), i);
                stack.pop_back();
            }
            if (!stack.empty()) {
                test(stack.back(), i);
            }
            stack.push_back(i);
        }
    }
    int Q;
    std::cin >> Q;
    while (Q--) {
        int t;
        std::cin >> t;
        if (t == 1) {
            int i, x;
            std::cin >> i >> x;
            i -= 1;
            A[i] = x;
            seq.update(i, x);
            range.pop(i, erase);
            vector<pair<int, ll>> left, right;
            {
                int k = i + 1;
                ll sum = 0;
                while (k < N) {
                    right.emplace_back(k, seq.sum(i + 1, k));
                    sum += A[k];   
                    k = seq.upb_to_right(k + 1, sum);
                    if (k == -1) {
                        break;
                    }
                } 
            }
            {
                int k = i - 1;
                ll sum = 0;
                while (k >= 0) {
                    left.emplace_back(k, seq.sum(k + 1, i));
                    sum += A[k];   
                    k = seq.upb_to_left(k, sum);
                    if (k == -1) {
                        break;
                    }
                } 
            }
            for (const auto& [l, sl] : left) {
                if (std::min(A[i], A[l]) > sl) {
                    insert(l, i);
                }
            }
            for (const auto& [r, sr] : right) {
                if (std::min(A[i], A[r]) > sr) {
                    insert(i, r);
                }
            }
            for (const auto& [l, sl] : left) {
                for (const auto& [r, sr] : right) {
                    if (std::min(A[l], A[r]) > sl + A[i] + sr) {
                        insert(l, r);
                    }
                }
            }
        } else {
            int l, r;
            std::cin >> l >> r;
            l -= 1;
            {
                ll sum = 0;
                const int lc = l;
                int cand = l;
                while (true) {
                    sum += A[l];
                    const int k = seq.upb_to_right(l + 1, sum);
                    if (k == -1 or k >= r) {
                        break;
                    }
                    if (seq.sum(lc, k) < A[k]) {
                        cand = k;
                    }
                    l = k;
                }
                l = cand;
            }
            {
                ll sum = 0;
                const int rc = r;
                int cand = r;
                while (true) {
                    sum += A[r - 1];
                    const int k = seq.upb_to_left(r - 1, sum);
                    if (k == -1 or k < l) {
                        break;
                    }
                    if (seq.sum(k + 1, rc) < A[k]) {
                        cand = k + 1;
                    }
                    r = k + 1;
                }
                r = cand;
            }
            std::cout << seg.fold(l, r) << '\n';
        } 
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 2 ms 304 KB Output is correct
6 Correct 3 ms 340 KB Output is correct
7 Correct 3 ms 340 KB Output is correct
8 Correct 2 ms 340 KB Output is correct
9 Correct 2 ms 340 KB Output is correct
10 Correct 2 ms 340 KB Output is correct
11 Correct 2 ms 340 KB Output is correct
12 Correct 2 ms 340 KB Output is correct
13 Correct 2 ms 340 KB Output is correct
14 Correct 2 ms 340 KB Output is correct
15 Correct 2 ms 340 KB Output is correct
16 Correct 2 ms 304 KB Output is correct
17 Correct 2 ms 340 KB Output is correct
18 Correct 2 ms 304 KB Output is correct
19 Correct 2 ms 340 KB Output is correct
20 Correct 3 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 50 ms 15444 KB Output is correct
3 Correct 43 ms 15568 KB Output is correct
4 Correct 50 ms 15532 KB Output is correct
5 Correct 43 ms 15628 KB Output is correct
6 Correct 60 ms 15624 KB Output is correct
7 Correct 31 ms 15112 KB Output is correct
8 Correct 54 ms 15684 KB Output is correct
9 Correct 29 ms 15180 KB Output is correct
10 Correct 43 ms 15000 KB Output is correct
11 Correct 35 ms 15156 KB Output is correct
12 Correct 34 ms 15564 KB Output is correct
13 Correct 31 ms 15532 KB Output is correct
14 Correct 46 ms 16168 KB Output is correct
15 Correct 47 ms 15892 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 2 ms 304 KB Output is correct
6 Correct 3 ms 340 KB Output is correct
7 Correct 3 ms 340 KB Output is correct
8 Correct 2 ms 340 KB Output is correct
9 Correct 2 ms 340 KB Output is correct
10 Correct 2 ms 340 KB Output is correct
11 Correct 2 ms 340 KB Output is correct
12 Correct 2 ms 340 KB Output is correct
13 Correct 2 ms 340 KB Output is correct
14 Correct 2 ms 340 KB Output is correct
15 Correct 2 ms 340 KB Output is correct
16 Correct 2 ms 304 KB Output is correct
17 Correct 2 ms 340 KB Output is correct
18 Correct 2 ms 304 KB Output is correct
19 Correct 2 ms 340 KB Output is correct
20 Correct 3 ms 340 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 50 ms 15444 KB Output is correct
23 Correct 43 ms 15568 KB Output is correct
24 Correct 50 ms 15532 KB Output is correct
25 Correct 43 ms 15628 KB Output is correct
26 Correct 60 ms 15624 KB Output is correct
27 Correct 31 ms 15112 KB Output is correct
28 Correct 54 ms 15684 KB Output is correct
29 Correct 29 ms 15180 KB Output is correct
30 Correct 43 ms 15000 KB Output is correct
31 Correct 35 ms 15156 KB Output is correct
32 Correct 34 ms 15564 KB Output is correct
33 Correct 31 ms 15532 KB Output is correct
34 Correct 46 ms 16168 KB Output is correct
35 Correct 47 ms 15892 KB Output is correct
36 Correct 61 ms 15912 KB Output is correct
37 Correct 54 ms 15776 KB Output is correct
38 Correct 46 ms 15632 KB Output is correct
39 Correct 76 ms 15908 KB Output is correct
40 Correct 45 ms 15584 KB Output is correct
41 Correct 56 ms 16288 KB Output is correct
42 Correct 67 ms 16296 KB Output is correct
43 Correct 37 ms 15180 KB Output is correct
44 Correct 36 ms 15120 KB Output is correct
45 Correct 52 ms 15396 KB Output is correct
46 Correct 47 ms 15356 KB Output is correct
47 Correct 38 ms 14936 KB Output is correct
48 Correct 38 ms 15536 KB Output is correct
49 Correct 38 ms 15604 KB Output is correct
50 Correct 50 ms 16432 KB Output is correct
51 Correct 53 ms 16284 KB Output is correct
52 Correct 51 ms 16460 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 50 ms 15444 KB Output is correct
3 Correct 43 ms 15568 KB Output is correct
4 Correct 50 ms 15532 KB Output is correct
5 Correct 43 ms 15628 KB Output is correct
6 Correct 60 ms 15624 KB Output is correct
7 Correct 31 ms 15112 KB Output is correct
8 Correct 54 ms 15684 KB Output is correct
9 Correct 29 ms 15180 KB Output is correct
10 Correct 43 ms 15000 KB Output is correct
11 Correct 35 ms 15156 KB Output is correct
12 Correct 34 ms 15564 KB Output is correct
13 Correct 31 ms 15532 KB Output is correct
14 Correct 46 ms 16168 KB Output is correct
15 Correct 47 ms 15892 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 475 ms 15516 KB Output is correct
18 Correct 357 ms 15564 KB Output is correct
19 Correct 458 ms 15564 KB Output is correct
20 Correct 478 ms 15564 KB Output is correct
21 Correct 471 ms 15564 KB Output is correct
22 Correct 362 ms 15432 KB Output is correct
23 Correct 439 ms 15548 KB Output is correct
24 Correct 508 ms 15564 KB Output is correct
25 Correct 449 ms 15632 KB Output is correct
26 Correct 542 ms 15568 KB Output is correct
27 Correct 323 ms 15668 KB Output is correct
28 Correct 337 ms 15668 KB Output is correct
29 Correct 340 ms 15564 KB Output is correct
30 Correct 568 ms 15052 KB Output is correct
31 Correct 577 ms 15012 KB Output is correct
32 Correct 562 ms 15168 KB Output is correct
33 Correct 353 ms 15052 KB Output is correct
34 Correct 563 ms 14928 KB Output is correct
35 Correct 441 ms 14768 KB Output is correct
36 Correct 398 ms 14924 KB Output is correct
37 Correct 330 ms 15436 KB Output is correct
38 Correct 363 ms 15444 KB Output is correct
39 Correct 329 ms 16048 KB Output is correct
40 Correct 346 ms 15824 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 50 ms 15444 KB Output is correct
3 Correct 43 ms 15568 KB Output is correct
4 Correct 50 ms 15532 KB Output is correct
5 Correct 43 ms 15628 KB Output is correct
6 Correct 60 ms 15624 KB Output is correct
7 Correct 31 ms 15112 KB Output is correct
8 Correct 54 ms 15684 KB Output is correct
9 Correct 29 ms 15180 KB Output is correct
10 Correct 43 ms 15000 KB Output is correct
11 Correct 35 ms 15156 KB Output is correct
12 Correct 34 ms 15564 KB Output is correct
13 Correct 31 ms 15532 KB Output is correct
14 Correct 46 ms 16168 KB Output is correct
15 Correct 47 ms 15892 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 462 ms 15408 KB Output is correct
18 Correct 490 ms 17896 KB Output is correct
19 Correct 500 ms 16148 KB Output is correct
20 Correct 446 ms 17720 KB Output is correct
21 Correct 653 ms 16412 KB Output is correct
22 Correct 523 ms 17888 KB Output is correct
23 Correct 600 ms 16340 KB Output is correct
24 Correct 506 ms 17852 KB Output is correct
25 Correct 578 ms 16132 KB Output is correct
26 Correct 307 ms 17472 KB Output is correct
27 Correct 321 ms 17800 KB Output is correct
28 Correct 393 ms 16920 KB Output is correct
29 Correct 319 ms 17520 KB Output is correct
30 Correct 361 ms 17592 KB Output is correct
31 Correct 408 ms 17164 KB Output is correct
32 Correct 479 ms 17476 KB Output is correct
33 Correct 336 ms 15856 KB Output is correct
34 Correct 499 ms 17876 KB Output is correct
35 Correct 284 ms 16056 KB Output is correct
36 Correct 433 ms 17260 KB Output is correct
37 Correct 405 ms 16784 KB Output is correct
38 Correct 349 ms 16644 KB Output is correct
39 Correct 364 ms 17740 KB Output is correct
40 Correct 292 ms 17380 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 2 ms 304 KB Output is correct
6 Correct 3 ms 340 KB Output is correct
7 Correct 3 ms 340 KB Output is correct
8 Correct 2 ms 340 KB Output is correct
9 Correct 2 ms 340 KB Output is correct
10 Correct 2 ms 340 KB Output is correct
11 Correct 2 ms 340 KB Output is correct
12 Correct 2 ms 340 KB Output is correct
13 Correct 2 ms 340 KB Output is correct
14 Correct 2 ms 340 KB Output is correct
15 Correct 2 ms 340 KB Output is correct
16 Correct 2 ms 304 KB Output is correct
17 Correct 2 ms 340 KB Output is correct
18 Correct 2 ms 304 KB Output is correct
19 Correct 2 ms 340 KB Output is correct
20 Correct 3 ms 340 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 50 ms 15444 KB Output is correct
23 Correct 43 ms 15568 KB Output is correct
24 Correct 50 ms 15532 KB Output is correct
25 Correct 43 ms 15628 KB Output is correct
26 Correct 60 ms 15624 KB Output is correct
27 Correct 31 ms 15112 KB Output is correct
28 Correct 54 ms 15684 KB Output is correct
29 Correct 29 ms 15180 KB Output is correct
30 Correct 43 ms 15000 KB Output is correct
31 Correct 35 ms 15156 KB Output is correct
32 Correct 34 ms 15564 KB Output is correct
33 Correct 31 ms 15532 KB Output is correct
34 Correct 46 ms 16168 KB Output is correct
35 Correct 47 ms 15892 KB Output is correct
36 Correct 61 ms 15912 KB Output is correct
37 Correct 54 ms 15776 KB Output is correct
38 Correct 46 ms 15632 KB Output is correct
39 Correct 76 ms 15908 KB Output is correct
40 Correct 45 ms 15584 KB Output is correct
41 Correct 56 ms 16288 KB Output is correct
42 Correct 67 ms 16296 KB Output is correct
43 Correct 37 ms 15180 KB Output is correct
44 Correct 36 ms 15120 KB Output is correct
45 Correct 52 ms 15396 KB Output is correct
46 Correct 47 ms 15356 KB Output is correct
47 Correct 38 ms 14936 KB Output is correct
48 Correct 38 ms 15536 KB Output is correct
49 Correct 38 ms 15604 KB Output is correct
50 Correct 50 ms 16432 KB Output is correct
51 Correct 53 ms 16284 KB Output is correct
52 Correct 51 ms 16460 KB Output is correct
53 Correct 1 ms 212 KB Output is correct
54 Correct 475 ms 15516 KB Output is correct
55 Correct 357 ms 15564 KB Output is correct
56 Correct 458 ms 15564 KB Output is correct
57 Correct 478 ms 15564 KB Output is correct
58 Correct 471 ms 15564 KB Output is correct
59 Correct 362 ms 15432 KB Output is correct
60 Correct 439 ms 15548 KB Output is correct
61 Correct 508 ms 15564 KB Output is correct
62 Correct 449 ms 15632 KB Output is correct
63 Correct 542 ms 15568 KB Output is correct
64 Correct 323 ms 15668 KB Output is correct
65 Correct 337 ms 15668 KB Output is correct
66 Correct 340 ms 15564 KB Output is correct
67 Correct 568 ms 15052 KB Output is correct
68 Correct 577 ms 15012 KB Output is correct
69 Correct 562 ms 15168 KB Output is correct
70 Correct 353 ms 15052 KB Output is correct
71 Correct 563 ms 14928 KB Output is correct
72 Correct 441 ms 14768 KB Output is correct
73 Correct 398 ms 14924 KB Output is correct
74 Correct 330 ms 15436 KB Output is correct
75 Correct 363 ms 15444 KB Output is correct
76 Correct 329 ms 16048 KB Output is correct
77 Correct 346 ms 15824 KB Output is correct
78 Correct 1 ms 212 KB Output is correct
79 Correct 462 ms 15408 KB Output is correct
80 Correct 490 ms 17896 KB Output is correct
81 Correct 500 ms 16148 KB Output is correct
82 Correct 446 ms 17720 KB Output is correct
83 Correct 653 ms 16412 KB Output is correct
84 Correct 523 ms 17888 KB Output is correct
85 Correct 600 ms 16340 KB Output is correct
86 Correct 506 ms 17852 KB Output is correct
87 Correct 578 ms 16132 KB Output is correct
88 Correct 307 ms 17472 KB Output is correct
89 Correct 321 ms 17800 KB Output is correct
90 Correct 393 ms 16920 KB Output is correct
91 Correct 319 ms 17520 KB Output is correct
92 Correct 361 ms 17592 KB Output is correct
93 Correct 408 ms 17164 KB Output is correct
94 Correct 479 ms 17476 KB Output is correct
95 Correct 336 ms 15856 KB Output is correct
96 Correct 499 ms 17876 KB Output is correct
97 Correct 284 ms 16056 KB Output is correct
98 Correct 433 ms 17260 KB Output is correct
99 Correct 405 ms 16784 KB Output is correct
100 Correct 349 ms 16644 KB Output is correct
101 Correct 364 ms 17740 KB Output is correct
102 Correct 292 ms 17380 KB Output is correct
103 Correct 552 ms 15848 KB Output is correct
104 Correct 471 ms 18244 KB Output is correct
105 Correct 577 ms 16800 KB Output is correct
106 Correct 469 ms 17268 KB Output is correct
107 Correct 711 ms 16176 KB Output is correct
108 Correct 509 ms 18216 KB Output is correct
109 Correct 554 ms 16492 KB Output is correct
110 Correct 530 ms 17600 KB Output is correct
111 Correct 600 ms 16840 KB Output is correct
112 Correct 470 ms 17156 KB Output is correct
113 Correct 380 ms 17692 KB Output is correct
114 Correct 358 ms 17476 KB Output is correct
115 Correct 426 ms 17176 KB Output is correct
116 Correct 415 ms 16944 KB Output is correct
117 Correct 347 ms 17564 KB Output is correct
118 Correct 434 ms 16420 KB Output is correct
119 Correct 362 ms 17684 KB Output is correct
120 Correct 408 ms 17012 KB Output is correct
121 Correct 438 ms 16840 KB Output is correct
122 Correct 492 ms 17432 KB Output is correct
123 Correct 336 ms 15860 KB Output is correct
124 Correct 466 ms 16804 KB Output is correct
125 Correct 469 ms 15828 KB Output is correct
126 Correct 454 ms 16516 KB Output is correct
127 Correct 435 ms 16740 KB Output is correct
128 Correct 362 ms 16608 KB Output is correct
129 Correct 403 ms 17876 KB Output is correct
130 Correct 353 ms 17400 KB Output is correct