답안 #1117909

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1117909 2024-11-24T09:42:47 Z Pannda Bulldozer (JOI17_bulldozer) C++17
75 / 100
1990 ms 300020 KB
#include <bits/stdc++.h>
using namespace std;

// supports: point modify, range apply, range query, walk to find first/last with some precedent
// you are to implement the 2 structs Tag and Info
// for the walks, pass a lambda that takes in Info and return true iff the node with that Info will contain the desired element

template<class Info, class Tag>
struct LazySegmentTree {
    int n;
    vector<Info> info;
    vector<Tag> tag;
    LazySegmentTree() : n(0) {}
    LazySegmentTree(int n_, Info v_ = Info()) {
        init(n_, v_);
    }
    template<class T>
    LazySegmentTree(vector<T> init_) {
        init(init_);
    }
    void init(int n_, Info v_ = Info()) {
        init(vector<Info>(n_, v_));
    }
    template<class T>
    void init(vector<T> init_) {
        n = init_.size();
        info.assign(4 << __lg(n), Info());
        tag.assign(4 << __lg(n), Tag());
        function<void(int, int, int)> build = [&](int p, int l, int r) {
            if (r - l == 1) {
                info[p] = init_[l];
                return;
            }
            int m = (l + r) / 2;
            build(2 * p, l, m);
            build(2 * p + 1, m, r);
            pull(p);
        };
        build(1, 0, n);
    }
    void pull(int p) {
        info[p] = info[2 * p] + info[2 * p + 1];
    }
    void apply(int p, const Tag &v) {
        info[p].apply(v);
        tag[p].apply(v);
    }
    void push(int p) {
        apply(2 * p, tag[p]);
        apply(2 * p + 1, tag[p]);
        tag[p] = Tag();
    }
    void modify(int p, int l, int r, int x, const Info &v) {
        if (r - l == 1) {
            info[p] = v;
            return;
        }
        int m = (l + r) / 2;
        push(p);
        if (x < m) {
            modify(2 * p, l, m, x, v);
        } else {
            modify(2 * p + 1, m, r, x, v);
        }
        pull(p);
    }
    void modify(int p, const Info &v) {
        modify(1, 0, n, p, v);
    }
    Info rangeQuery(int p, int l, int r, int x, int y) {
        if (l >= y || r <= x) {
            return Info();
        }
        if (l >= x && r <= y) {
            return info[p];
        }
        int m = (l + r) / 2;
        push(p);
        return rangeQuery(2 * p, l, m, x, y) + rangeQuery(2 * p + 1, m, r, x, y);
    }
    Info rangeQuery(int l, int r) {
        return rangeQuery(1, 0, n, l, r);
    }
    void rangeApply(int p, int l, int r, int x, int y, const Tag &v) {
        if (l >= y || r <= x) {
            return;
        }
        if (l >= x && r <= y) {
            apply(p, v);
            return;
        }
        int m = (l + r) / 2;
        push(p);
        rangeApply(2 * p, l, m, x, y, v);
        rangeApply(2 * p + 1, m, r, x, y, v);
        pull(p);
    }
    void rangeApply(int l, int r, const Tag &v) {
        return rangeApply(1, 0, n, l, r, v);
    }
    template<class F>
    int findFirst(int p, int l, int r, int x, int y, F &&pred) {
        if (l >= y || r <= x) {
            return -1;
        }
        if (l >= x && r <= y && !pred(info[p])) {
            return -1;
        }
        if (r - l == 1) {
            return l;
        }
        int m = (l + r) / 2;
        push(p);
        int res = findFirst(2 * p, l, m, x, y, pred);
        if (res == -1) {
            res = findFirst(2 * p + 1, m, r, x, y, pred);
        }
        return res;
    }
    template<class F>
    int findFirst(int l, int r, F &&pred) {
        return findFirst(1, 0, n, l, r, pred);
    }
    template<class F>
    int findLast(int p, int l, int r, int x, int y, F &&pred) {
        if (l >= y || r <= x) {
            return -1;
        }
        if (l >= x && r <= y && !pred(info[p])) {
            return -1;
        }
        if (r - l == 1) {
            return l;
        }
        int m = (l + r) / 2;
        push(p);
        int res = findLast(2 * p + 1, m, r, x, y, pred);
        if (res == -1) {
            res = findLast(2 * p, l, m, x, y, pred);
        }
        return res;
    }
    template<class F>
    int findLast(int l, int r, F &&pred) {
        return findLast(1, 0, n, l, r, pred);
    }
};

struct Tag {
    void apply(const Tag &t) & {
    }
};

struct Info {
    long long sum;
    long long premax;
    long long sufmax;
    long long allmax;
    Info() {
        sum = premax = sufmax = allmax = 0;
    }
    Info(int x) {
        sum = x;
        premax = sufmax = allmax = max(0, x);
    }
    void apply(const Tag &t) & {
    }
    Info operator+(const Info &b) {
        Info res;
        res.sum = sum + b.sum;
        res.premax = max(premax, sum + b.premax);
        res.sufmax = max(sufmax + b.sum, b.sufmax);
        res.allmax = max({ allmax, b.allmax, sufmax + b.premax });
        return res;
    }
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;
    vector<array<int, 2>> a(n);
    vector<int> w(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i][0] >> a[i][1] >> w[i];
    }

    auto norm = [&](array<int, 2> p) -> long long {
        return 1LL * p[0] * p[0] + 1LL * p[1] * p[1];
    };

    vector<pair<vector<int>, vector<int>>> instructions = [&] { // Give list of instructions, each try to sorts a certain subset
        struct Fraction {
            const int INF = 2e9 + 10;
            int num, den;
            Fraction(int num, int den) {
                if (den < 0) num *= -1, den *= -1;
                if (den == 0) {
                    assert(num != 0);
                    if (num > 0) num = INF;
                    else num = -INF;
                    den = 1;
                }
                this->num = num;
                this->den = den;
            }
            bool operator<(Fraction other) {
                return 1LL * num * other.den < 1LL * other.num * den;
            }
            bool operator==(Fraction other) {
                return 1LL * num * other.den == 1LL * other.num * den;
            }
            bool operator>(Fraction other) {
                return 1LL * num * other.den > 1LL * other.num * den;
            }
            bool operator!=(Fraction other) {
                return !(*this == other);
            }
            Fraction operator=(Fraction other) {
                this->num = other.num;
                this->den = other.den;
                return *this;
            }
        };
        vector<pair<Fraction, array<int, 2>>> fetch;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (i == j) continue;
                auto [x0, y0] = a[i];
                auto [x1, y1] = a[j];
                Fraction tan_theta(x0 - x1, y0 - y1);
                if (tan_theta == Fraction(1, 0)) continue;
                fetch.push_back(make_pair(tan_theta, array<int, 2>{i, j}));
            }
        }
        sort(fetch.begin(), fetch.end(), [&](auto F, auto S) -> bool {
            auto [frac0, ij0] = F;
            auto [i0, j0] = ij0;
            auto [frac1, ij1] = S;
            auto [i1, j1] = ij1;
            return frac0 < frac1;
        });
        vector<pair<vector<int>, vector<int>>> res;
        for (int i = 0; i < fetch.size(); ) {
            Fraction tan_theta = fetch[i].first;
            vector<int> ids;
            ids.push_back(fetch[i].second[0]);
            ids.push_back(fetch[i].second[1]);
            int j = i + 1;
            while (j < fetch.size() && fetch[i].first == fetch[j].first) {
                ids.push_back(fetch[j].second[0]);
                ids.push_back(fetch[j].second[1]);
                j++;
            }
            sort(ids.begin(), ids.end());
            ids.resize(unique(ids.begin(), ids.end()) - ids.begin());
            i = j;

            sort(ids.begin(), ids.end(), [&](int i, int j) -> bool {
                if (Fraction(a[i][0] - a[j][0], a[i][1] - a[j][1]) != tan_theta) {
                    return (a[i][1] - a[j][1] < 0) ^ (Fraction(a[i][0] - a[j][0], a[i][1] - a[j][1]) < tan_theta);
                }
                return (a[i][0] - a[j][0] < 0) ^ (Fraction(a[j][1] - a[i][1], a[i][0] - a[j][0]) > tan_theta);
            });
            vector<int> unstable = ids;

            sort(ids.begin(), ids.end(), [&](int i, int j) -> bool {
                if (Fraction(a[i][0] - a[j][0], a[i][1] - a[j][1]) != tan_theta) {
                    return (a[i][1] - a[j][1] < 0) ^ (Fraction(a[i][0] - a[j][0], a[i][1] - a[j][1]) < tan_theta);
                }
                return (a[i][0] - a[j][0] < 0) ^ (Fraction(a[j][1] - a[i][1], a[i][0] - a[j][0]) < tan_theta);
            });
            vector<int> stable = ids;

            res.push_back(make_pair(unstable, stable));
        }
        return res;
    }();

    vector<int> p(n);
    iota(p.begin(), p.end(), 0);
    sort(p.begin(), p.end(), [&](int i, int j) {
        if (a[i][1] != a[j][1]) return a[i][1] < a[j][1];
        return a[i][0] > a[j][0];
    });
    vector<int> ip(n);
    for (int i = 0; i < n; i++) {
        ip[p[i]] = i;
    }

    LazySegmentTree<Info, Tag> seg(n);
    for (int i = 0; i < n; i++) {
        seg.modify(i, w[p[i]]);
    }
    long long ans = seg.rangeQuery(0, n).allmax;

    for (auto [unstable, stable] : instructions) {
        vector<int> positions;
        for (int x : unstable) {
            positions.push_back(ip[x]);
        }
        sort(positions.begin(), positions.end());

        int ii = 0;
        for (int i : positions) {
            p[i] = unstable[ii++];
            seg.modify(i, w[p[i]]);
            ip[p[i]] = i;
        }
        ans = max(ans, seg.rangeQuery(0, n).allmax);

        ii = 0;
        for (int i : positions) {
            p[i] = stable[ii++];
            seg.modify(i, w[p[i]]);
            ip[p[i]] = i;
        }
        ans = max(ans, seg.rangeQuery(0, n).allmax);
    }

    cout << ans << '\n';
}

Compilation message

bulldozer.cpp: In lambda function:
bulldozer.cpp:246:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<main()::<lambda()>::Fraction, std::array<int, 2> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  246 |         for (int i = 0; i < fetch.size(); ) {
      |                         ~~^~~~~~~~~~~~~~
bulldozer.cpp:252:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<main()::<lambda()>::Fraction, std::array<int, 2> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  252 |             while (j < fetch.size() && fetch[i].first == fetch[j].first) {
      |                    ~~^~~~~~~~~~~~~~
bulldozer.cpp: In function 'int main()':
bulldozer.cpp:190:10: warning: variable 'norm' set but not used [-Wunused-but-set-variable]
  190 |     auto norm = [&](array<int, 2> p) -> long long {
      |          ^~~~
bulldozer.cpp: In instantiation of 'main()::<lambda()>::<lambda(auto:23, auto:24)> [with auto:23 = std::pair<main()::<lambda()>::Fraction, std::array<int, 2> >; auto:24 = std::pair<main()::<lambda()>::Fraction, std::array<int, 2> >]':
/usr/include/c++/10/bits/predefined_ops.h:156:30:   required from 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator<std::pair<main()::<lambda()>::Fraction, std::array<int, 2> >*, std::vector<std::pair<main()::<lambda()>::Fraction, std::array<int, 2> > > >; _Iterator2 = __gnu_cxx::__normal_iterator<std::pair<main()::<lambda()>::Fraction, std::array<int, 2> >*, std::vector<std::pair<main()::<lambda()>::Fraction, std::array<int, 2> > > >; _Compare = main()::<lambda()>::<lambda(auto:23, auto:24)>]'
/usr/include/c++/10/bits/stl_algo.h:82:17:   required from 'void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = __gnu_cxx::__normal_iterator<std::pair<main()::<lambda()>::Fraction, std::array<int, 2> >*, std::vector<std::pair<main()::<lambda()>::Fraction, std::array<int, 2> > > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<main()::<lambda()>::<lambda(auto:23, auto:24)> >]'
/usr/include/c++/10/bits/stl_algo.h:1924:34:   required from '_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<main()::<lambda()>::Fraction, std::array<int, 2> >*, std::vector<std::pair<main()::<lambda()>::Fraction, std::array<int, 2> > > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<main()::<lambda()>::<lambda(auto:23, auto:24)> >]'
/usr/include/c++/10/bits/stl_algo.h:1958:38:   required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<main()::<lambda()>::Fraction, std::array<int, 2> >*, std::vector<std::pair<main()::<lambda()>::Fraction, std::array<int, 2> > > >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<main()::<lambda()>::<lambda(auto:23, auto:24)> >]'
/usr/include/c++/10/bits/stl_algo.h:1974:25:   required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<main()::<lambda()>::Fraction, std::array<int, 2> >*, std::vector<std::pair<main()::<lambda()>::Fraction, std::array<int, 2> > > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<main()::<lambda()>::<lambda(auto:23, auto:24)> >]'
/usr/include/c++/10/bits/stl_algo.h:4892:18:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<std::pair<main()::<lambda()>::Fraction, std::array<int, 2> >*, std::vector<std::pair<main()::<lambda()>::Fraction, std::array<int, 2> > > >; _Compare = main()::<lambda()>::<lambda(auto:23, auto:24)>]'
bulldozer.cpp:244:10:   required from here
bulldozer.cpp:240:18: warning: structured binding declaration set but not used [-Wunused-but-set-variable]
  240 |             auto [i0, j0] = ij0;
      |                  ^~~~~~~~
bulldozer.cpp:242:18: warning: structured binding declaration set but not used [-Wunused-but-set-variable]
  242 |             auto [i1, j1] = ij1;
      |                  ^~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 592 KB Output is correct
2 Correct 2 ms 592 KB Output is correct
3 Correct 2 ms 592 KB Output is correct
4 Correct 2 ms 760 KB Output is correct
5 Incorrect 2 ms 592 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 1168 KB Output is correct
2 Correct 5 ms 1168 KB Output is correct
3 Correct 5 ms 1168 KB Output is correct
4 Correct 5 ms 1168 KB Output is correct
5 Correct 5 ms 1168 KB Output is correct
6 Correct 5 ms 1168 KB Output is correct
7 Correct 4 ms 1168 KB Output is correct
8 Correct 7 ms 1168 KB Output is correct
9 Correct 5 ms 1168 KB Output is correct
10 Correct 5 ms 1168 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 1 ms 504 KB Output is correct
16 Correct 1 ms 336 KB Output is correct
17 Correct 1 ms 508 KB Output is correct
18 Correct 1 ms 336 KB Output is correct
19 Correct 1 ms 504 KB Output is correct
20 Correct 1 ms 336 KB Output is correct
21 Correct 5 ms 1168 KB Output is correct
22 Correct 4 ms 1168 KB Output is correct
23 Correct 4 ms 1168 KB Output is correct
24 Correct 5 ms 1168 KB Output is correct
25 Correct 4 ms 1168 KB Output is correct
26 Correct 4 ms 1168 KB Output is correct
27 Correct 4 ms 1168 KB Output is correct
28 Correct 4 ms 1232 KB Output is correct
29 Correct 4 ms 1304 KB Output is correct
30 Correct 4 ms 1168 KB Output is correct
31 Correct 4 ms 1272 KB Output is correct
32 Correct 4 ms 1168 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 1168 KB Output is correct
2 Correct 5 ms 1168 KB Output is correct
3 Correct 5 ms 1168 KB Output is correct
4 Correct 5 ms 1168 KB Output is correct
5 Correct 5 ms 1168 KB Output is correct
6 Correct 5 ms 1168 KB Output is correct
7 Correct 4 ms 1168 KB Output is correct
8 Correct 7 ms 1168 KB Output is correct
9 Correct 5 ms 1168 KB Output is correct
10 Correct 5 ms 1168 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 1 ms 504 KB Output is correct
16 Correct 1 ms 336 KB Output is correct
17 Correct 1 ms 508 KB Output is correct
18 Correct 1 ms 336 KB Output is correct
19 Correct 1 ms 504 KB Output is correct
20 Correct 1 ms 336 KB Output is correct
21 Correct 5 ms 1168 KB Output is correct
22 Correct 4 ms 1168 KB Output is correct
23 Correct 4 ms 1168 KB Output is correct
24 Correct 5 ms 1168 KB Output is correct
25 Correct 4 ms 1168 KB Output is correct
26 Correct 4 ms 1168 KB Output is correct
27 Correct 4 ms 1168 KB Output is correct
28 Correct 4 ms 1232 KB Output is correct
29 Correct 4 ms 1304 KB Output is correct
30 Correct 4 ms 1168 KB Output is correct
31 Correct 4 ms 1272 KB Output is correct
32 Correct 4 ms 1168 KB Output is correct
33 Correct 1889 ms 299896 KB Output is correct
34 Correct 1830 ms 299900 KB Output is correct
35 Correct 1852 ms 300004 KB Output is correct
36 Correct 1820 ms 300004 KB Output is correct
37 Correct 1902 ms 299888 KB Output is correct
38 Correct 1912 ms 299968 KB Output is correct
39 Correct 1916 ms 300008 KB Output is correct
40 Correct 1888 ms 300008 KB Output is correct
41 Correct 1826 ms 300008 KB Output is correct
42 Correct 1917 ms 299900 KB Output is correct
43 Correct 1990 ms 299820 KB Output is correct
44 Correct 1927 ms 299900 KB Output is correct
45 Correct 1956 ms 299848 KB Output is correct
46 Correct 1944 ms 299940 KB Output is correct
47 Correct 1853 ms 300004 KB Output is correct
48 Correct 1816 ms 299900 KB Output is correct
49 Correct 1963 ms 299980 KB Output is correct
50 Correct 1839 ms 299896 KB Output is correct
51 Correct 1846 ms 300004 KB Output is correct
52 Correct 1918 ms 300004 KB Output is correct
53 Correct 1890 ms 299896 KB Output is correct
54 Correct 1787 ms 299900 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 1168 KB Output is correct
2 Correct 5 ms 1168 KB Output is correct
3 Correct 5 ms 1168 KB Output is correct
4 Correct 5 ms 1168 KB Output is correct
5 Correct 5 ms 1168 KB Output is correct
6 Correct 5 ms 1168 KB Output is correct
7 Correct 4 ms 1168 KB Output is correct
8 Correct 7 ms 1168 KB Output is correct
9 Correct 5 ms 1168 KB Output is correct
10 Correct 5 ms 1168 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 1 ms 504 KB Output is correct
16 Correct 1 ms 336 KB Output is correct
17 Correct 1 ms 508 KB Output is correct
18 Correct 1 ms 336 KB Output is correct
19 Correct 1 ms 504 KB Output is correct
20 Correct 1 ms 336 KB Output is correct
21 Correct 5 ms 1168 KB Output is correct
22 Correct 4 ms 1168 KB Output is correct
23 Correct 4 ms 1168 KB Output is correct
24 Correct 5 ms 1168 KB Output is correct
25 Correct 4 ms 1168 KB Output is correct
26 Correct 4 ms 1168 KB Output is correct
27 Correct 4 ms 1168 KB Output is correct
28 Correct 4 ms 1232 KB Output is correct
29 Correct 4 ms 1304 KB Output is correct
30 Correct 4 ms 1168 KB Output is correct
31 Correct 4 ms 1272 KB Output is correct
32 Correct 4 ms 1168 KB Output is correct
33 Correct 1889 ms 299896 KB Output is correct
34 Correct 1830 ms 299900 KB Output is correct
35 Correct 1852 ms 300004 KB Output is correct
36 Correct 1820 ms 300004 KB Output is correct
37 Correct 1902 ms 299888 KB Output is correct
38 Correct 1912 ms 299968 KB Output is correct
39 Correct 1916 ms 300008 KB Output is correct
40 Correct 1888 ms 300008 KB Output is correct
41 Correct 1826 ms 300008 KB Output is correct
42 Correct 1917 ms 299900 KB Output is correct
43 Correct 1990 ms 299820 KB Output is correct
44 Correct 1927 ms 299900 KB Output is correct
45 Correct 1956 ms 299848 KB Output is correct
46 Correct 1944 ms 299940 KB Output is correct
47 Correct 1853 ms 300004 KB Output is correct
48 Correct 1816 ms 299900 KB Output is correct
49 Correct 1963 ms 299980 KB Output is correct
50 Correct 1839 ms 299896 KB Output is correct
51 Correct 1846 ms 300004 KB Output is correct
52 Correct 1918 ms 300004 KB Output is correct
53 Correct 1890 ms 299896 KB Output is correct
54 Correct 1787 ms 299900 KB Output is correct
55 Correct 1783 ms 300004 KB Output is correct
56 Correct 1861 ms 300020 KB Output is correct
57 Correct 1955 ms 299900 KB Output is correct
58 Correct 1923 ms 299896 KB Output is correct
59 Correct 1869 ms 299984 KB Output is correct
60 Correct 1918 ms 299980 KB Output is correct
61 Correct 1887 ms 299900 KB Output is correct
62 Correct 1849 ms 300000 KB Output is correct
63 Correct 1938 ms 299948 KB Output is correct
64 Correct 1883 ms 299916 KB Output is correct
65 Correct 1864 ms 299824 KB Output is correct
66 Correct 1968 ms 299904 KB Output is correct
67 Correct 1886 ms 299792 KB Output is correct
68 Correct 1832 ms 299828 KB Output is correct
69 Correct 1912 ms 299952 KB Output is correct
70 Correct 1938 ms 299796 KB Output is correct
71 Correct 1887 ms 299732 KB Output is correct
72 Correct 1849 ms 299900 KB Output is correct
73 Correct 1887 ms 299932 KB Output is correct
74 Correct 1856 ms 299848 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 592 KB Output is correct
2 Correct 2 ms 592 KB Output is correct
3 Correct 2 ms 592 KB Output is correct
4 Correct 2 ms 760 KB Output is correct
5 Incorrect 2 ms 592 KB Output isn't correct
6 Halted 0 ms 0 KB -