Submission #987556

# Submission time Handle Problem Language Result Execution time Memory
987556 2024-05-23T03:34:20 Z PurpleCrayon Alternating Current (BOI18_alternating) C++17
100 / 100
101 ms 16540 KB
#include <bits/stdc++.h>
using namespace std;
 
#define sz(v) int(v.size())
#define ar array
typedef long long ll;
const int N = 1e5+10, MOD = 1e9+7;

void no() {
    cout << "impossible\n";
}

int ans[N];
vector<int> adj[N];

bool dfs(int c, int b) {
    ans[c] = b;
    for (int nxt : adj[c]) {
        if (ans[nxt] == -1) {
            if (!dfs(nxt, b ^ 1)) return false;
        }
        else if (ans[nxt] == b) return false;
    }

    return true;
}

void solve() {
    int n, m; cin >> n >> m;
    vector<pair<int, int>> v(m);
    for (int i = 0; i < m; i++) adj[i].clear();
    for (int i = 0; i < m; i++) {
        int a, b; cin >> a >> b, --a, --b;
        v[i] = {a, b};
    }


    vector<int> cnt(n);

    auto add = [&](int l, int r) {
        cnt[l]++;
        if (r < n-1) cnt[r+1]--;
    };

    for (auto [l, r] : v) {
        if (l <= r) {
            add(l, r);
        } else {
            add(l, n-1);
            add(0, r);
        }
    }

    for (int i = 1; i < n; i++) cnt[i] += cnt[i-1];
    if (*min_element(cnt.begin(), cnt.end()) < 2) {
        no();
        return;
    }

    vector<int> use;
    for (int i = 0; i < n; i++) {
        if (cnt[i] == 2) {
            use.push_back(i);
        }
    }

    fill(ans, ans + m, -1);
    bool done_no = 0;
    auto solve_hard = [&]() {
        auto get_nxt = [&](int i) {
            int idx = lower_bound(use.begin(), use.end(), i) - use.begin();
            if (idx == sz(use)) return use[0];
            return use[idx];
        };

        // cerr << "use: ";
        // for (int x : use) cerr << x << ' ';
        // cerr << endl;

        vector<vector<int>> mine(n);
        for (int i = 0; i < m; i++) {
            auto [l, r] = v[i];
            // cerr << "> " << l << ' ' << r << endl;
            set<int> mark;
            if (l <= r) {
                int c = get_nxt(l);
                while (!mark.count(c) && l <= c && c <= r) {
                    // cerr << c << ' ';
                    mark.insert(c);
                    c = get_nxt((c + 1) % n);
                }
                // cerr << endl << endl;
            } else {
                int c = get_nxt(l);
                while (!mark.count(c) && (c >= l || c <= r)) {
                    // cerr << c << ' ';
                    mark.insert(c);
                    c = get_nxt((c + 1) % n);
                }
                // cerr << endl << endl;
            }
            for (int x : mark) {
                mine[x].push_back(i);
            }
        }

        for (int x : use) {
            assert(sz(mine[x]) == 2);
            int one = mine[x][0], two = mine[x][1];
            // cerr << "> " << one << ' ' << two << endl;
            adj[one].push_back(two);
            adj[two].push_back(one);
        }

        for (int i = 0; i < m; i++) if (sz(adj[i]) && ans[i] == -1) {
            if (!dfs(i, 0)) {
                no();
                done_no = 1;
                return;
            }
        }
    };


    if (sz(use)) solve_hard();
    if (done_no) return;
    vector<int> one;
    for (int i = 0; i < m; i++) {
        if (ans[i] == 0 || ans[i] == -1) {
            one.push_back(i);
        }
    }

    auto reduce = [&]() { // clean one
        pair<int, int> big{-1, -1};
        vector<vector<int>> who(n);
        for (int x : one) {
            auto [l, r] = v[x];
            who[l].push_back(x);
            if (l <= r) {
                big = max(big, make_pair(r - l + 1, x));
            } else {
                big = max(big, make_pair(n - (l - r - 1), x));
            }
        }

        int start = v[big.second].first;

        auto dist = [&](int x) {
            return (x + n - start) % n;
        };
        
        vector<pair<int, int>> fake_v = v;
        for (auto& [l, r] : fake_v) {
            if (dist(r) < dist(l)) {
                r = (start + n - 1) % n;
            }
        }

        int p = (start + 1) % n;
        int last = big.second;
        vector<int> new_one; new_one.push_back(last);
        while (true) {
            pair<int, int> best{-1, -1};
            while (p != start && dist(p) <= dist(fake_v[last].second) + 1) {
                for (int x : who[p]) {
                    auto [l, r] = fake_v[x];
                    best = max(best, make_pair(dist(r), x));
                }
                p = (p + 1) % n;
            }

            // cerr << "> " << last << ' ' << p << ' ' << best.second << endl;

            if (best.second == -1 || dist(fake_v[best.second].second) <= dist(fake_v[last].second)) break;

            last = best.second;
            new_one.push_back(last);
        }

        swap(one, new_one);
    };

    /*
    for (int x : one) cerr << x << ' ';
    cerr << endl;
    */
    reduce();
    /*
    for (int x : one) cerr << x << ' ';
    cerr << endl;
    */

    for (int x : one) {
        ans[x] = 0;
    }

    vector<int> two;
    for (int i = 0; i < m; i++) {
        if (ans[i] != 0) {
            ans[i] = 1;
            two.push_back(i);
        }
    }

    auto good = [&](vector<int> idx) { // check
        vector<int> cnt_check(n);

        auto add_check = [&](int l, int r) {
            cnt_check[l]++;
            if (r < n-1) cnt_check[r+1]--;
        };

        for (int x : idx) {
            auto [l, r] = v[x];
            if (l <= r) {
                add_check(l, r);
            } else {
                add_check(l, n-1);
                add_check(0, r);
            }
        }

        for (int i = 1; i < n; i++) cnt_check[i] += cnt_check[i-1];

        return *min_element(cnt_check.begin(), cnt_check.end()) > 0;
    };

    if (!good(one) || !good(two)) {
        no();
        return;
    }

    for (int i = 0; i < m; i++) cout << ans[i];
    cout << '\n';
}
 
int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int T = 1;
    // cin >> T;
    while (T--) solve();
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 1 ms 2652 KB Output is correct
3 Correct 2 ms 2652 KB Output is correct
4 Correct 1 ms 2652 KB Output is correct
5 Correct 1 ms 2652 KB Output is correct
6 Correct 2 ms 2652 KB Output is correct
7 Correct 2 ms 2688 KB Output is correct
8 Correct 2 ms 2648 KB Output is correct
9 Correct 2 ms 2652 KB Output is correct
10 Correct 3 ms 2652 KB Output is correct
11 Correct 2 ms 2652 KB Output is correct
12 Correct 2 ms 2652 KB Output is correct
13 Correct 2 ms 2648 KB Output is correct
14 Correct 2 ms 2652 KB Output is correct
15 Correct 2 ms 2652 KB Output is correct
16 Correct 2 ms 2652 KB Output is correct
17 Correct 2 ms 2652 KB Output is correct
18 Correct 1 ms 2652 KB Output is correct
19 Correct 2 ms 2652 KB Output is correct
20 Correct 2 ms 2652 KB Output is correct
21 Correct 1 ms 2652 KB Output is correct
22 Correct 2 ms 2652 KB Output is correct
23 Correct 2 ms 2652 KB Output is correct
24 Correct 2 ms 2648 KB Output is correct
25 Correct 2 ms 2652 KB Output is correct
26 Correct 2 ms 2652 KB Output is correct
27 Correct 1 ms 2652 KB Output is correct
28 Correct 1 ms 2652 KB Output is correct
29 Correct 1 ms 2652 KB Output is correct
30 Correct 1 ms 2652 KB Output is correct
31 Correct 1 ms 2652 KB Output is correct
32 Correct 1 ms 2652 KB Output is correct
33 Correct 2 ms 2652 KB Output is correct
34 Correct 2 ms 2652 KB Output is correct
35 Correct 2 ms 2648 KB Output is correct
36 Correct 3 ms 2652 KB Output is correct
37 Correct 2 ms 2652 KB Output is correct
38 Correct 1 ms 2652 KB Output is correct
39 Correct 1 ms 2652 KB Output is correct
40 Correct 2 ms 2652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 1 ms 2652 KB Output is correct
3 Correct 2 ms 2652 KB Output is correct
4 Correct 1 ms 2652 KB Output is correct
5 Correct 1 ms 2652 KB Output is correct
6 Correct 2 ms 2652 KB Output is correct
7 Correct 2 ms 2688 KB Output is correct
8 Correct 2 ms 2648 KB Output is correct
9 Correct 2 ms 2652 KB Output is correct
10 Correct 3 ms 2652 KB Output is correct
11 Correct 2 ms 2652 KB Output is correct
12 Correct 2 ms 2652 KB Output is correct
13 Correct 2 ms 2648 KB Output is correct
14 Correct 2 ms 2652 KB Output is correct
15 Correct 2 ms 2652 KB Output is correct
16 Correct 2 ms 2652 KB Output is correct
17 Correct 2 ms 2652 KB Output is correct
18 Correct 1 ms 2652 KB Output is correct
19 Correct 2 ms 2652 KB Output is correct
20 Correct 2 ms 2652 KB Output is correct
21 Correct 1 ms 2652 KB Output is correct
22 Correct 2 ms 2652 KB Output is correct
23 Correct 2 ms 2652 KB Output is correct
24 Correct 2 ms 2648 KB Output is correct
25 Correct 2 ms 2652 KB Output is correct
26 Correct 2 ms 2652 KB Output is correct
27 Correct 1 ms 2652 KB Output is correct
28 Correct 1 ms 2652 KB Output is correct
29 Correct 1 ms 2652 KB Output is correct
30 Correct 1 ms 2652 KB Output is correct
31 Correct 1 ms 2652 KB Output is correct
32 Correct 1 ms 2652 KB Output is correct
33 Correct 2 ms 2652 KB Output is correct
34 Correct 2 ms 2652 KB Output is correct
35 Correct 2 ms 2648 KB Output is correct
36 Correct 3 ms 2652 KB Output is correct
37 Correct 2 ms 2652 KB Output is correct
38 Correct 1 ms 2652 KB Output is correct
39 Correct 1 ms 2652 KB Output is correct
40 Correct 2 ms 2652 KB Output is correct
41 Correct 1 ms 2652 KB Output is correct
42 Correct 2 ms 2652 KB Output is correct
43 Correct 2 ms 2652 KB Output is correct
44 Correct 2 ms 2652 KB Output is correct
45 Correct 1 ms 2652 KB Output is correct
46 Correct 2 ms 2652 KB Output is correct
47 Correct 2 ms 2652 KB Output is correct
48 Correct 2 ms 2652 KB Output is correct
49 Correct 2 ms 2808 KB Output is correct
50 Correct 2 ms 2652 KB Output is correct
51 Correct 2 ms 2648 KB Output is correct
52 Correct 2 ms 2652 KB Output is correct
53 Correct 2 ms 2652 KB Output is correct
54 Correct 2 ms 2652 KB Output is correct
55 Correct 2 ms 2636 KB Output is correct
56 Correct 2 ms 2652 KB Output is correct
57 Correct 2 ms 2652 KB Output is correct
58 Correct 2 ms 2652 KB Output is correct
59 Correct 2 ms 2652 KB Output is correct
60 Correct 2 ms 2652 KB Output is correct
61 Correct 2 ms 2904 KB Output is correct
62 Correct 2 ms 2652 KB Output is correct
63 Correct 2 ms 2652 KB Output is correct
64 Correct 2 ms 2652 KB Output is correct
65 Correct 1 ms 2648 KB Output is correct
66 Correct 1 ms 2652 KB Output is correct
67 Correct 1 ms 2652 KB Output is correct
68 Correct 2 ms 2648 KB Output is correct
69 Correct 2 ms 2652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 1 ms 2652 KB Output is correct
3 Correct 2 ms 2652 KB Output is correct
4 Correct 1 ms 2652 KB Output is correct
5 Correct 1 ms 2652 KB Output is correct
6 Correct 2 ms 2652 KB Output is correct
7 Correct 2 ms 2688 KB Output is correct
8 Correct 2 ms 2648 KB Output is correct
9 Correct 2 ms 2652 KB Output is correct
10 Correct 3 ms 2652 KB Output is correct
11 Correct 2 ms 2652 KB Output is correct
12 Correct 2 ms 2652 KB Output is correct
13 Correct 2 ms 2648 KB Output is correct
14 Correct 2 ms 2652 KB Output is correct
15 Correct 2 ms 2652 KB Output is correct
16 Correct 2 ms 2652 KB Output is correct
17 Correct 2 ms 2652 KB Output is correct
18 Correct 1 ms 2652 KB Output is correct
19 Correct 2 ms 2652 KB Output is correct
20 Correct 2 ms 2652 KB Output is correct
21 Correct 1 ms 2652 KB Output is correct
22 Correct 2 ms 2652 KB Output is correct
23 Correct 2 ms 2652 KB Output is correct
24 Correct 2 ms 2648 KB Output is correct
25 Correct 2 ms 2652 KB Output is correct
26 Correct 2 ms 2652 KB Output is correct
27 Correct 1 ms 2652 KB Output is correct
28 Correct 1 ms 2652 KB Output is correct
29 Correct 1 ms 2652 KB Output is correct
30 Correct 1 ms 2652 KB Output is correct
31 Correct 1 ms 2652 KB Output is correct
32 Correct 1 ms 2652 KB Output is correct
33 Correct 2 ms 2652 KB Output is correct
34 Correct 2 ms 2652 KB Output is correct
35 Correct 2 ms 2648 KB Output is correct
36 Correct 3 ms 2652 KB Output is correct
37 Correct 2 ms 2652 KB Output is correct
38 Correct 1 ms 2652 KB Output is correct
39 Correct 1 ms 2652 KB Output is correct
40 Correct 2 ms 2652 KB Output is correct
41 Correct 1 ms 2652 KB Output is correct
42 Correct 2 ms 2652 KB Output is correct
43 Correct 2 ms 2652 KB Output is correct
44 Correct 2 ms 2652 KB Output is correct
45 Correct 1 ms 2652 KB Output is correct
46 Correct 2 ms 2652 KB Output is correct
47 Correct 2 ms 2652 KB Output is correct
48 Correct 2 ms 2652 KB Output is correct
49 Correct 2 ms 2808 KB Output is correct
50 Correct 2 ms 2652 KB Output is correct
51 Correct 2 ms 2648 KB Output is correct
52 Correct 2 ms 2652 KB Output is correct
53 Correct 2 ms 2652 KB Output is correct
54 Correct 2 ms 2652 KB Output is correct
55 Correct 2 ms 2636 KB Output is correct
56 Correct 2 ms 2652 KB Output is correct
57 Correct 2 ms 2652 KB Output is correct
58 Correct 2 ms 2652 KB Output is correct
59 Correct 2 ms 2652 KB Output is correct
60 Correct 2 ms 2652 KB Output is correct
61 Correct 2 ms 2904 KB Output is correct
62 Correct 2 ms 2652 KB Output is correct
63 Correct 2 ms 2652 KB Output is correct
64 Correct 2 ms 2652 KB Output is correct
65 Correct 1 ms 2648 KB Output is correct
66 Correct 1 ms 2652 KB Output is correct
67 Correct 1 ms 2652 KB Output is correct
68 Correct 2 ms 2648 KB Output is correct
69 Correct 2 ms 2652 KB Output is correct
70 Correct 2 ms 2648 KB Output is correct
71 Correct 3 ms 2904 KB Output is correct
72 Correct 2 ms 2648 KB Output is correct
73 Correct 2 ms 2648 KB Output is correct
74 Correct 2 ms 2660 KB Output is correct
75 Correct 2 ms 2648 KB Output is correct
76 Correct 2 ms 2652 KB Output is correct
77 Correct 2 ms 2652 KB Output is correct
78 Correct 2 ms 2656 KB Output is correct
79 Correct 2 ms 2656 KB Output is correct
80 Correct 2 ms 2656 KB Output is correct
81 Correct 2 ms 2652 KB Output is correct
82 Correct 2 ms 2656 KB Output is correct
83 Correct 2 ms 2656 KB Output is correct
84 Correct 2 ms 2912 KB Output is correct
85 Correct 2 ms 2808 KB Output is correct
86 Correct 2 ms 2908 KB Output is correct
87 Correct 2 ms 2908 KB Output is correct
88 Correct 2 ms 2908 KB Output is correct
89 Correct 3 ms 2652 KB Output is correct
90 Correct 2 ms 2648 KB Output is correct
91 Correct 2 ms 2648 KB Output is correct
92 Correct 1 ms 2648 KB Output is correct
93 Correct 1 ms 2652 KB Output is correct
94 Correct 2 ms 2904 KB Output is correct
95 Correct 1 ms 2652 KB Output is correct
96 Correct 2 ms 2652 KB Output is correct
97 Correct 2 ms 2652 KB Output is correct
98 Correct 2 ms 2652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 21 ms 9052 KB Output is correct
2 Correct 67 ms 13732 KB Output is correct
3 Correct 7 ms 3928 KB Output is correct
4 Correct 18 ms 8756 KB Output is correct
5 Correct 95 ms 15156 KB Output is correct
6 Correct 14 ms 4956 KB Output is correct
7 Correct 95 ms 15852 KB Output is correct
8 Correct 34 ms 8624 KB Output is correct
9 Correct 26 ms 7976 KB Output is correct
10 Correct 94 ms 15848 KB Output is correct
11 Correct 80 ms 14160 KB Output is correct
12 Correct 101 ms 16540 KB Output is correct
13 Correct 2 ms 3164 KB Output is correct
14 Correct 2 ms 3164 KB Output is correct
15 Correct 30 ms 10836 KB Output is correct
16 Correct 7 ms 3932 KB Output is correct
17 Correct 30 ms 10856 KB Output is correct
18 Correct 23 ms 6872 KB Output is correct
19 Correct 2 ms 3164 KB Output is correct
20 Correct 44 ms 12868 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 1 ms 2652 KB Output is correct
3 Correct 2 ms 2652 KB Output is correct
4 Correct 1 ms 2652 KB Output is correct
5 Correct 1 ms 2652 KB Output is correct
6 Correct 2 ms 2652 KB Output is correct
7 Correct 2 ms 2688 KB Output is correct
8 Correct 2 ms 2648 KB Output is correct
9 Correct 2 ms 2652 KB Output is correct
10 Correct 3 ms 2652 KB Output is correct
11 Correct 2 ms 2652 KB Output is correct
12 Correct 2 ms 2652 KB Output is correct
13 Correct 2 ms 2648 KB Output is correct
14 Correct 2 ms 2652 KB Output is correct
15 Correct 2 ms 2652 KB Output is correct
16 Correct 2 ms 2652 KB Output is correct
17 Correct 2 ms 2652 KB Output is correct
18 Correct 1 ms 2652 KB Output is correct
19 Correct 2 ms 2652 KB Output is correct
20 Correct 2 ms 2652 KB Output is correct
21 Correct 1 ms 2652 KB Output is correct
22 Correct 2 ms 2652 KB Output is correct
23 Correct 2 ms 2652 KB Output is correct
24 Correct 2 ms 2648 KB Output is correct
25 Correct 2 ms 2652 KB Output is correct
26 Correct 2 ms 2652 KB Output is correct
27 Correct 1 ms 2652 KB Output is correct
28 Correct 1 ms 2652 KB Output is correct
29 Correct 1 ms 2652 KB Output is correct
30 Correct 1 ms 2652 KB Output is correct
31 Correct 1 ms 2652 KB Output is correct
32 Correct 1 ms 2652 KB Output is correct
33 Correct 2 ms 2652 KB Output is correct
34 Correct 2 ms 2652 KB Output is correct
35 Correct 2 ms 2648 KB Output is correct
36 Correct 3 ms 2652 KB Output is correct
37 Correct 2 ms 2652 KB Output is correct
38 Correct 1 ms 2652 KB Output is correct
39 Correct 1 ms 2652 KB Output is correct
40 Correct 2 ms 2652 KB Output is correct
41 Correct 1 ms 2652 KB Output is correct
42 Correct 2 ms 2652 KB Output is correct
43 Correct 2 ms 2652 KB Output is correct
44 Correct 2 ms 2652 KB Output is correct
45 Correct 1 ms 2652 KB Output is correct
46 Correct 2 ms 2652 KB Output is correct
47 Correct 2 ms 2652 KB Output is correct
48 Correct 2 ms 2652 KB Output is correct
49 Correct 2 ms 2808 KB Output is correct
50 Correct 2 ms 2652 KB Output is correct
51 Correct 2 ms 2648 KB Output is correct
52 Correct 2 ms 2652 KB Output is correct
53 Correct 2 ms 2652 KB Output is correct
54 Correct 2 ms 2652 KB Output is correct
55 Correct 2 ms 2636 KB Output is correct
56 Correct 2 ms 2652 KB Output is correct
57 Correct 2 ms 2652 KB Output is correct
58 Correct 2 ms 2652 KB Output is correct
59 Correct 2 ms 2652 KB Output is correct
60 Correct 2 ms 2652 KB Output is correct
61 Correct 2 ms 2904 KB Output is correct
62 Correct 2 ms 2652 KB Output is correct
63 Correct 2 ms 2652 KB Output is correct
64 Correct 2 ms 2652 KB Output is correct
65 Correct 1 ms 2648 KB Output is correct
66 Correct 1 ms 2652 KB Output is correct
67 Correct 1 ms 2652 KB Output is correct
68 Correct 2 ms 2648 KB Output is correct
69 Correct 2 ms 2652 KB Output is correct
70 Correct 2 ms 2648 KB Output is correct
71 Correct 3 ms 2904 KB Output is correct
72 Correct 2 ms 2648 KB Output is correct
73 Correct 2 ms 2648 KB Output is correct
74 Correct 2 ms 2660 KB Output is correct
75 Correct 2 ms 2648 KB Output is correct
76 Correct 2 ms 2652 KB Output is correct
77 Correct 2 ms 2652 KB Output is correct
78 Correct 2 ms 2656 KB Output is correct
79 Correct 2 ms 2656 KB Output is correct
80 Correct 2 ms 2656 KB Output is correct
81 Correct 2 ms 2652 KB Output is correct
82 Correct 2 ms 2656 KB Output is correct
83 Correct 2 ms 2656 KB Output is correct
84 Correct 2 ms 2912 KB Output is correct
85 Correct 2 ms 2808 KB Output is correct
86 Correct 2 ms 2908 KB Output is correct
87 Correct 2 ms 2908 KB Output is correct
88 Correct 2 ms 2908 KB Output is correct
89 Correct 3 ms 2652 KB Output is correct
90 Correct 2 ms 2648 KB Output is correct
91 Correct 2 ms 2648 KB Output is correct
92 Correct 1 ms 2648 KB Output is correct
93 Correct 1 ms 2652 KB Output is correct
94 Correct 2 ms 2904 KB Output is correct
95 Correct 1 ms 2652 KB Output is correct
96 Correct 2 ms 2652 KB Output is correct
97 Correct 2 ms 2652 KB Output is correct
98 Correct 2 ms 2652 KB Output is correct
99 Correct 21 ms 9052 KB Output is correct
100 Correct 67 ms 13732 KB Output is correct
101 Correct 7 ms 3928 KB Output is correct
102 Correct 18 ms 8756 KB Output is correct
103 Correct 95 ms 15156 KB Output is correct
104 Correct 14 ms 4956 KB Output is correct
105 Correct 95 ms 15852 KB Output is correct
106 Correct 34 ms 8624 KB Output is correct
107 Correct 26 ms 7976 KB Output is correct
108 Correct 94 ms 15848 KB Output is correct
109 Correct 80 ms 14160 KB Output is correct
110 Correct 101 ms 16540 KB Output is correct
111 Correct 2 ms 3164 KB Output is correct
112 Correct 2 ms 3164 KB Output is correct
113 Correct 30 ms 10836 KB Output is correct
114 Correct 7 ms 3932 KB Output is correct
115 Correct 30 ms 10856 KB Output is correct
116 Correct 23 ms 6872 KB Output is correct
117 Correct 2 ms 3164 KB Output is correct
118 Correct 44 ms 12868 KB Output is correct
119 Correct 43 ms 9936 KB Output is correct
120 Correct 84 ms 16452 KB Output is correct
121 Correct 68 ms 12712 KB Output is correct
122 Correct 2 ms 2648 KB Output is correct
123 Correct 3 ms 3160 KB Output is correct
124 Correct 7 ms 3676 KB Output is correct
125 Correct 47 ms 10388 KB Output is correct
126 Correct 36 ms 9228 KB Output is correct
127 Correct 27 ms 8160 KB Output is correct
128 Correct 99 ms 14628 KB Output is correct
129 Correct 68 ms 12968 KB Output is correct
130 Correct 72 ms 13288 KB Output is correct
131 Correct 60 ms 10672 KB Output is correct
132 Correct 44 ms 9932 KB Output is correct
133 Correct 31 ms 10960 KB Output is correct
134 Correct 12 ms 7260 KB Output is correct
135 Correct 8 ms 5980 KB Output is correct
136 Correct 9 ms 4164 KB Output is correct
137 Correct 13 ms 4700 KB Output is correct
138 Correct 6 ms 5468 KB Output is correct