Submission #1041627

# Submission time Handle Problem Language Result Execution time Memory
1041627 2024-08-02T06:28:52 Z 정민찬(#11002) Brought Down the Grading Server? (CEOI23_balance) C++17
100 / 100
387 ms 95488 KB
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

ll N, S, T;
vector<pair<ll,ll>> adj[1000010];
int deg[1000010];
int cnt[1000010];
int num[1000010];
int ori[1000010];
int vis[1000010];
vector<vector<int>> ans;

void dnc(int s, int e, vector<vector<int>> a) {
    if (s == e) {
        for (int i=0; i<N; i++) {
            ans[i][s] = a[i][0];
        }
        return;
    }
    int mid = s + e >> 1;
    vector<vector<int>> l(N), r(N);
    vector<int> D;
    int pv = 0;
    vector<int> used;
    for (int i=0; i<N; i++) {
        for (auto &x : a[i]) {
            cnt[x] ++;
        }
        vector<int> one;
        for (auto &x : a[i]) {
            if (cnt[x] == 0) continue;
            for (int j=0; j<cnt[x] / 2; j++) {
                l[i].push_back(x);
                r[i].push_back(x);
            }
            if (cnt[x] % 2 == 1) {
                one.push_back(x);
            }
            cnt[x] = 0;
        }
        assert(one.size() % 2 == 0);
        for (int j=0; j<one.size(); j+=2) {
            if (num[one[j]] == 0) {
                used.push_back(one[j]);
            }
            if (num[one[j+1]] == 0) {
                used.push_back(one[j+1]);
            }
            int node1, node2;
            if (num[one[j]] == 0 || deg[num[one[j]]] == 2) {
                num[one[j]] = ++ pv;
                ori[pv] = one[j];
            }
            deg[num[one[j]]] ++;
            node1 = num[one[j]];
            if (num[one[j+1]] == 0 || deg[num[one[j+1]]] == 2) {
                num[one[j+1]] = ++ pv;
                ori[pv] = one[j+1];
            }
            deg[num[one[j+1]]] ++;
            node2 = num[one[j+1]];
            adj[node1].push_back({node2, i});
            adj[node2].push_back({node1, i});
        }
    }
    int ppv = pv;
    for (int i=1; i<=ppv; i++) {
        if (deg[i] == 1) {
            if (ppv == pv || deg[pv] == 2) pv ++;
            adj[pv].push_back({i, -1});
            adj[i].push_back({pv, -1});
            deg[pv] ++;
        }
    }
    for (int i=1; i<=pv; i++) {
        if (vis[i] || adj[i].empty()) continue;
        int p = -1;
        int x = i;
        vector<int> vtx, edg;
        while (true) {
            vtx.push_back(x);
            vis[x] = 1;
            if (adj[x][0].first == p) swap(adj[x][0], adj[x][1]);
            edg.push_back(adj[x][0].second);
            p = x;
            x = adj[x][0].first;
            if (x == i) break;
        }
        for (ll j=0; j<vtx.size(); j++) {
            if (edg[j] == -1) continue;
            l[edg[j]].push_back(ori[vtx[j]]);
            r[edg[j]].push_back(ori[vtx[(j+1)%vtx.size()]]);
        }
    }
    for (int i=1; i<=pv; i++) {
        vis[i] = 0;
        deg[i] = 0;
        ori[i] = 0;
        adj[i].clear();
    }
    for (auto &x : used) {
        num[x] = 0;
    }
    dnc(s, mid, l);
    dnc(mid+1, e, r);
}

int main() {
    ios_base :: sync_with_stdio(false); cin.tie(NULL);
    cin >> N >> S >> T;
    ans.resize(N, vector<int>(S));
    for (ll i=0; i<N; i++) {
        for (ll j=0; j<S; j++) {
            cin >> ans[i][j];
        }
    }
    dnc(0, S-1, ans);
    for (ll i=0; i<N; i++) {
        for (ll j=0; j<S; j++) {
            cout << ans[i][j] << ' ';
        }
        cout << '\n';
    }

}

Compilation message

balance.cpp: In function 'void dnc(int, int, std::vector<std::vector<int> >)':
balance.cpp:22:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   22 |     int mid = s + e >> 1;
      |               ~~^~~
balance.cpp:44:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   44 |         for (int j=0; j<one.size(); j+=2) {
      |                       ~^~~~~~~~~~~
balance.cpp:91:23: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   91 |         for (ll j=0; j<vtx.size(); j++) {
      |                      ~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 4 ms 28764 KB Correct
2 Correct 4 ms 28764 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 29016 KB Correct
2 Correct 4 ms 28764 KB Correct
3 Correct 5 ms 28764 KB Correct
4 Correct 4 ms 29000 KB Correct
5 Correct 4 ms 28760 KB Correct
6 Correct 4 ms 28764 KB Correct
7 Correct 4 ms 28760 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 79 ms 66396 KB Correct
2 Correct 77 ms 65944 KB Correct
3 Correct 73 ms 60620 KB Correct
4 Correct 60 ms 60992 KB Correct
5 Correct 86 ms 66336 KB Correct
6 Correct 83 ms 66680 KB Correct
7 Correct 89 ms 66448 KB Correct
8 Correct 63 ms 66452 KB Correct
9 Correct 63 ms 67136 KB Correct
10 Correct 57 ms 66372 KB Correct
11 Correct 83 ms 66372 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 79 ms 66396 KB Correct
2 Correct 77 ms 65944 KB Correct
3 Correct 73 ms 60620 KB Correct
4 Correct 60 ms 60992 KB Correct
5 Correct 86 ms 66336 KB Correct
6 Correct 83 ms 66680 KB Correct
7 Correct 89 ms 66448 KB Correct
8 Correct 63 ms 66452 KB Correct
9 Correct 63 ms 67136 KB Correct
10 Correct 57 ms 66372 KB Correct
11 Correct 83 ms 66372 KB Correct
12 Correct 87 ms 66484 KB Correct
13 Correct 86 ms 65796 KB Correct
14 Correct 81 ms 60680 KB Correct
15 Correct 56 ms 61008 KB Correct
16 Correct 77 ms 66336 KB Correct
17 Correct 81 ms 66656 KB Correct
18 Correct 93 ms 66424 KB Correct
19 Correct 64 ms 66520 KB Correct
20 Correct 61 ms 67012 KB Correct
21 Correct 58 ms 66372 KB Correct
22 Correct 59 ms 66372 KB Correct
23 Correct 95 ms 69216 KB Correct
24 Correct 72 ms 65360 KB Correct
25 Correct 82 ms 66704 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 29016 KB Correct
2 Correct 4 ms 28764 KB Correct
3 Correct 5 ms 28764 KB Correct
4 Correct 4 ms 29000 KB Correct
5 Correct 4 ms 28760 KB Correct
6 Correct 4 ms 28764 KB Correct
7 Correct 4 ms 28760 KB Correct
8 Correct 79 ms 66396 KB Correct
9 Correct 77 ms 65944 KB Correct
10 Correct 73 ms 60620 KB Correct
11 Correct 60 ms 60992 KB Correct
12 Correct 86 ms 66336 KB Correct
13 Correct 83 ms 66680 KB Correct
14 Correct 89 ms 66448 KB Correct
15 Correct 63 ms 66452 KB Correct
16 Correct 63 ms 67136 KB Correct
17 Correct 57 ms 66372 KB Correct
18 Correct 83 ms 66372 KB Correct
19 Correct 87 ms 66484 KB Correct
20 Correct 86 ms 65796 KB Correct
21 Correct 81 ms 60680 KB Correct
22 Correct 56 ms 61008 KB Correct
23 Correct 77 ms 66336 KB Correct
24 Correct 81 ms 66656 KB Correct
25 Correct 93 ms 66424 KB Correct
26 Correct 64 ms 66520 KB Correct
27 Correct 61 ms 67012 KB Correct
28 Correct 58 ms 66372 KB Correct
29 Correct 59 ms 66372 KB Correct
30 Correct 95 ms 69216 KB Correct
31 Correct 72 ms 65360 KB Correct
32 Correct 82 ms 66704 KB Correct
33 Correct 4 ms 28764 KB Correct
34 Correct 4 ms 28972 KB Correct
35 Correct 4 ms 28764 KB Correct
36 Correct 4 ms 28764 KB Correct
37 Correct 4 ms 28764 KB Correct
38 Correct 5 ms 28764 KB Correct
39 Correct 4 ms 28764 KB Correct
40 Correct 82 ms 66480 KB Correct
41 Correct 78 ms 65944 KB Correct
42 Correct 73 ms 60616 KB Correct
43 Correct 61 ms 61008 KB Correct
44 Correct 76 ms 66276 KB Correct
45 Correct 82 ms 66680 KB Correct
46 Correct 83 ms 66508 KB Correct
47 Correct 70 ms 66340 KB Correct
48 Correct 59 ms 67140 KB Correct
49 Correct 56 ms 66444 KB Correct
50 Correct 57 ms 66336 KB Correct
51 Correct 87 ms 69144 KB Correct
52 Correct 73 ms 65364 KB Correct
53 Correct 83 ms 66700 KB Correct
54 Correct 49 ms 52476 KB Correct
55 Correct 5 ms 29784 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 28764 KB Correct
2 Correct 8 ms 29276 KB Correct
3 Correct 7 ms 29020 KB Correct
4 Correct 8 ms 30196 KB Correct
5 Correct 6 ms 30500 KB Correct
6 Correct 7 ms 30556 KB Correct
7 Correct 7 ms 30196 KB Correct
8 Correct 8 ms 30044 KB Correct
9 Correct 7 ms 30044 KB Correct
10 Correct 8 ms 30300 KB Correct
11 Correct 8 ms 30300 KB Correct
12 Correct 7 ms 30632 KB Correct
13 Correct 10 ms 30556 KB Correct
14 Correct 7 ms 30556 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 28764 KB Correct
2 Correct 8 ms 29276 KB Correct
3 Correct 7 ms 29020 KB Correct
4 Correct 8 ms 30196 KB Correct
5 Correct 6 ms 30500 KB Correct
6 Correct 7 ms 30556 KB Correct
7 Correct 7 ms 30196 KB Correct
8 Correct 8 ms 30044 KB Correct
9 Correct 7 ms 30044 KB Correct
10 Correct 8 ms 30300 KB Correct
11 Correct 8 ms 30300 KB Correct
12 Correct 7 ms 30632 KB Correct
13 Correct 10 ms 30556 KB Correct
14 Correct 7 ms 30556 KB Correct
15 Correct 4 ms 28764 KB Correct
16 Correct 8 ms 29276 KB Correct
17 Correct 8 ms 29020 KB Correct
18 Correct 7 ms 30196 KB Correct
19 Correct 6 ms 30300 KB Correct
20 Correct 9 ms 30556 KB Correct
21 Correct 8 ms 30196 KB Correct
22 Correct 9 ms 30044 KB Correct
23 Correct 7 ms 30044 KB Correct
24 Correct 8 ms 30348 KB Correct
25 Correct 7 ms 30312 KB Correct
26 Correct 8 ms 30556 KB Correct
27 Correct 7 ms 30556 KB Correct
28 Correct 6 ms 30556 KB Correct
29 Correct 9 ms 29276 KB Correct
30 Correct 8 ms 30420 KB Correct
31 Correct 8 ms 30044 KB Correct
32 Correct 9 ms 30464 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 28764 KB Correct
2 Correct 8 ms 29276 KB Correct
3 Correct 7 ms 29020 KB Correct
4 Correct 8 ms 30196 KB Correct
5 Correct 6 ms 30500 KB Correct
6 Correct 7 ms 30556 KB Correct
7 Correct 7 ms 30196 KB Correct
8 Correct 8 ms 30044 KB Correct
9 Correct 7 ms 30044 KB Correct
10 Correct 8 ms 30300 KB Correct
11 Correct 8 ms 30300 KB Correct
12 Correct 7 ms 30632 KB Correct
13 Correct 10 ms 30556 KB Correct
14 Correct 7 ms 30556 KB Correct
15 Correct 4 ms 28764 KB Correct
16 Correct 8 ms 29276 KB Correct
17 Correct 8 ms 29020 KB Correct
18 Correct 7 ms 30196 KB Correct
19 Correct 6 ms 30300 KB Correct
20 Correct 9 ms 30556 KB Correct
21 Correct 8 ms 30196 KB Correct
22 Correct 9 ms 30044 KB Correct
23 Correct 7 ms 30044 KB Correct
24 Correct 8 ms 30348 KB Correct
25 Correct 7 ms 30312 KB Correct
26 Correct 8 ms 30556 KB Correct
27 Correct 7 ms 30556 KB Correct
28 Correct 6 ms 30556 KB Correct
29 Correct 9 ms 29276 KB Correct
30 Correct 8 ms 30420 KB Correct
31 Correct 8 ms 30044 KB Correct
32 Correct 9 ms 30464 KB Correct
33 Correct 5 ms 28764 KB Correct
34 Correct 8 ms 29276 KB Correct
35 Correct 7 ms 29204 KB Correct
36 Correct 7 ms 30140 KB Correct
37 Correct 8 ms 30500 KB Correct
38 Correct 8 ms 30556 KB Correct
39 Correct 7 ms 30196 KB Correct
40 Correct 8 ms 30044 KB Correct
41 Correct 8 ms 30092 KB Correct
42 Correct 7 ms 30300 KB Correct
43 Correct 7 ms 30300 KB Correct
44 Correct 7 ms 30556 KB Correct
45 Correct 7 ms 30556 KB Correct
46 Correct 8 ms 30556 KB Correct
47 Correct 8 ms 29276 KB Correct
48 Correct 8 ms 30420 KB Correct
49 Correct 8 ms 30044 KB Correct
50 Correct 8 ms 30300 KB Correct
51 Correct 4 ms 28764 KB Correct
52 Correct 4 ms 29000 KB Correct
53 Correct 4 ms 28764 KB Correct
54 Correct 4 ms 28764 KB Correct
55 Correct 4 ms 28900 KB Correct
56 Correct 4 ms 28764 KB Correct
57 Correct 5 ms 28764 KB Correct
58 Correct 14 ms 30556 KB Correct
59 Correct 14 ms 30264 KB Correct
60 Correct 9 ms 30300 KB Correct
61 Correct 9 ms 30556 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 79 ms 66396 KB Correct
2 Correct 77 ms 65944 KB Correct
3 Correct 73 ms 60620 KB Correct
4 Correct 60 ms 60992 KB Correct
5 Correct 86 ms 66336 KB Correct
6 Correct 83 ms 66680 KB Correct
7 Correct 89 ms 66448 KB Correct
8 Correct 63 ms 66452 KB Correct
9 Correct 63 ms 67136 KB Correct
10 Correct 57 ms 66372 KB Correct
11 Correct 83 ms 66372 KB Correct
12 Correct 5 ms 28764 KB Correct
13 Correct 8 ms 29276 KB Correct
14 Correct 7 ms 29020 KB Correct
15 Correct 8 ms 30196 KB Correct
16 Correct 6 ms 30500 KB Correct
17 Correct 7 ms 30556 KB Correct
18 Correct 7 ms 30196 KB Correct
19 Correct 8 ms 30044 KB Correct
20 Correct 7 ms 30044 KB Correct
21 Correct 8 ms 30300 KB Correct
22 Correct 8 ms 30300 KB Correct
23 Correct 7 ms 30632 KB Correct
24 Correct 10 ms 30556 KB Correct
25 Correct 7 ms 30556 KB Correct
26 Correct 82 ms 66520 KB Correct
27 Correct 78 ms 65944 KB Correct
28 Correct 94 ms 60432 KB Correct
29 Correct 55 ms 60992 KB Correct
30 Correct 80 ms 66272 KB Correct
31 Correct 90 ms 66684 KB Correct
32 Correct 90 ms 66612 KB Correct
33 Correct 67 ms 66452 KB Correct
34 Correct 65 ms 66964 KB Correct
35 Correct 59 ms 66372 KB Correct
36 Correct 59 ms 66372 KB Correct
37 Correct 5 ms 28760 KB Correct
38 Correct 10 ms 29276 KB Correct
39 Correct 7 ms 29020 KB Correct
40 Correct 8 ms 30196 KB Correct
41 Correct 7 ms 30300 KB Correct
42 Correct 7 ms 30556 KB Correct
43 Correct 7 ms 30248 KB Correct
44 Correct 8 ms 30040 KB Correct
45 Correct 9 ms 30040 KB Correct
46 Correct 9 ms 30300 KB Correct
47 Correct 6 ms 30300 KB Correct
48 Correct 6 ms 30556 KB Correct
49 Correct 7 ms 30556 KB Correct
50 Correct 7 ms 30556 KB Correct
51 Correct 383 ms 86376 KB Correct
52 Correct 297 ms 45368 KB Correct
53 Correct 68 ms 31316 KB Correct
54 Correct 110 ms 42904 KB Correct
55 Correct 204 ms 43348 KB Correct
56 Correct 330 ms 82724 KB Correct
57 Correct 375 ms 87380 KB Correct
58 Correct 185 ms 41556 KB Correct
59 Correct 150 ms 39252 KB Correct
60 Correct 266 ms 78752 KB Correct
61 Correct 330 ms 82672 KB Correct
62 Correct 154 ms 85432 KB Correct
63 Correct 160 ms 85564 KB Correct
64 Correct 145 ms 84608 KB Correct
65 Correct 152 ms 85248 KB Correct
66 Correct 133 ms 85388 KB Correct
67 Correct 159 ms 84964 KB Correct
68 Correct 153 ms 83180 KB Correct
69 Correct 135 ms 83328 KB Correct
70 Correct 151 ms 74576 KB Correct
71 Correct 156 ms 74744 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 79 ms 66396 KB Correct
2 Correct 77 ms 65944 KB Correct
3 Correct 73 ms 60620 KB Correct
4 Correct 60 ms 60992 KB Correct
5 Correct 86 ms 66336 KB Correct
6 Correct 83 ms 66680 KB Correct
7 Correct 89 ms 66448 KB Correct
8 Correct 63 ms 66452 KB Correct
9 Correct 63 ms 67136 KB Correct
10 Correct 57 ms 66372 KB Correct
11 Correct 83 ms 66372 KB Correct
12 Correct 87 ms 66484 KB Correct
13 Correct 86 ms 65796 KB Correct
14 Correct 81 ms 60680 KB Correct
15 Correct 56 ms 61008 KB Correct
16 Correct 77 ms 66336 KB Correct
17 Correct 81 ms 66656 KB Correct
18 Correct 93 ms 66424 KB Correct
19 Correct 64 ms 66520 KB Correct
20 Correct 61 ms 67012 KB Correct
21 Correct 58 ms 66372 KB Correct
22 Correct 59 ms 66372 KB Correct
23 Correct 95 ms 69216 KB Correct
24 Correct 72 ms 65360 KB Correct
25 Correct 82 ms 66704 KB Correct
26 Correct 5 ms 28764 KB Correct
27 Correct 8 ms 29276 KB Correct
28 Correct 7 ms 29020 KB Correct
29 Correct 8 ms 30196 KB Correct
30 Correct 6 ms 30500 KB Correct
31 Correct 7 ms 30556 KB Correct
32 Correct 7 ms 30196 KB Correct
33 Correct 8 ms 30044 KB Correct
34 Correct 7 ms 30044 KB Correct
35 Correct 8 ms 30300 KB Correct
36 Correct 8 ms 30300 KB Correct
37 Correct 7 ms 30632 KB Correct
38 Correct 10 ms 30556 KB Correct
39 Correct 7 ms 30556 KB Correct
40 Correct 4 ms 28764 KB Correct
41 Correct 8 ms 29276 KB Correct
42 Correct 8 ms 29020 KB Correct
43 Correct 7 ms 30196 KB Correct
44 Correct 6 ms 30300 KB Correct
45 Correct 9 ms 30556 KB Correct
46 Correct 8 ms 30196 KB Correct
47 Correct 9 ms 30044 KB Correct
48 Correct 7 ms 30044 KB Correct
49 Correct 8 ms 30348 KB Correct
50 Correct 7 ms 30312 KB Correct
51 Correct 8 ms 30556 KB Correct
52 Correct 7 ms 30556 KB Correct
53 Correct 6 ms 30556 KB Correct
54 Correct 9 ms 29276 KB Correct
55 Correct 8 ms 30420 KB Correct
56 Correct 8 ms 30044 KB Correct
57 Correct 9 ms 30464 KB Correct
58 Correct 82 ms 66520 KB Correct
59 Correct 78 ms 65944 KB Correct
60 Correct 94 ms 60432 KB Correct
61 Correct 55 ms 60992 KB Correct
62 Correct 80 ms 66272 KB Correct
63 Correct 90 ms 66684 KB Correct
64 Correct 90 ms 66612 KB Correct
65 Correct 67 ms 66452 KB Correct
66 Correct 65 ms 66964 KB Correct
67 Correct 59 ms 66372 KB Correct
68 Correct 59 ms 66372 KB Correct
69 Correct 5 ms 28760 KB Correct
70 Correct 10 ms 29276 KB Correct
71 Correct 7 ms 29020 KB Correct
72 Correct 8 ms 30196 KB Correct
73 Correct 7 ms 30300 KB Correct
74 Correct 7 ms 30556 KB Correct
75 Correct 7 ms 30248 KB Correct
76 Correct 8 ms 30040 KB Correct
77 Correct 9 ms 30040 KB Correct
78 Correct 9 ms 30300 KB Correct
79 Correct 6 ms 30300 KB Correct
80 Correct 6 ms 30556 KB Correct
81 Correct 7 ms 30556 KB Correct
82 Correct 7 ms 30556 KB Correct
83 Correct 383 ms 86376 KB Correct
84 Correct 297 ms 45368 KB Correct
85 Correct 68 ms 31316 KB Correct
86 Correct 110 ms 42904 KB Correct
87 Correct 204 ms 43348 KB Correct
88 Correct 330 ms 82724 KB Correct
89 Correct 375 ms 87380 KB Correct
90 Correct 185 ms 41556 KB Correct
91 Correct 150 ms 39252 KB Correct
92 Correct 266 ms 78752 KB Correct
93 Correct 330 ms 82672 KB Correct
94 Correct 154 ms 85432 KB Correct
95 Correct 160 ms 85564 KB Correct
96 Correct 145 ms 84608 KB Correct
97 Correct 152 ms 85248 KB Correct
98 Correct 133 ms 85388 KB Correct
99 Correct 159 ms 84964 KB Correct
100 Correct 153 ms 83180 KB Correct
101 Correct 135 ms 83328 KB Correct
102 Correct 151 ms 74576 KB Correct
103 Correct 156 ms 74744 KB Correct
104 Correct 85 ms 66540 KB Correct
105 Correct 76 ms 65944 KB Correct
106 Correct 80 ms 61576 KB Correct
107 Correct 61 ms 61264 KB Correct
108 Correct 98 ms 66276 KB Correct
109 Correct 87 ms 67704 KB Correct
110 Correct 86 ms 67756 KB Correct
111 Correct 73 ms 67476 KB Correct
112 Correct 63 ms 66992 KB Correct
113 Correct 57 ms 66904 KB Correct
114 Correct 64 ms 67392 KB Correct
115 Correct 4 ms 28760 KB Correct
116 Correct 9 ms 29404 KB Correct
117 Correct 7 ms 29020 KB Correct
118 Correct 8 ms 30196 KB Correct
119 Correct 6 ms 30388 KB Correct
120 Correct 7 ms 30672 KB Correct
121 Correct 7 ms 30192 KB Correct
122 Correct 7 ms 30044 KB Correct
123 Correct 8 ms 29900 KB Correct
124 Correct 8 ms 30300 KB Correct
125 Correct 8 ms 30264 KB Correct
126 Correct 7 ms 30728 KB Correct
127 Correct 7 ms 30556 KB Correct
128 Correct 7 ms 30556 KB Correct
129 Correct 331 ms 87904 KB Correct
130 Correct 283 ms 44876 KB Correct
131 Correct 42 ms 31312 KB Correct
132 Correct 95 ms 42944 KB Correct
133 Correct 213 ms 43092 KB Correct
134 Correct 272 ms 83688 KB Correct
135 Correct 348 ms 89424 KB Correct
136 Correct 167 ms 41608 KB Correct
137 Correct 141 ms 39364 KB Correct
138 Correct 231 ms 79320 KB Correct
139 Correct 302 ms 79748 KB Correct
140 Correct 130 ms 84620 KB Correct
141 Correct 142 ms 85640 KB Correct
142 Correct 126 ms 85048 KB Correct
143 Correct 135 ms 84504 KB Correct
144 Correct 138 ms 85100 KB Correct
145 Correct 126 ms 85472 KB Correct
146 Correct 135 ms 85244 KB Correct
147 Correct 139 ms 85116 KB Correct
148 Correct 155 ms 77412 KB Correct
149 Correct 156 ms 77560 KB Correct
150 Correct 86 ms 69144 KB Correct
151 Correct 75 ms 65360 KB Correct
152 Correct 89 ms 67724 KB Correct
153 Correct 8 ms 29276 KB Correct
154 Correct 8 ms 30384 KB Correct
155 Correct 8 ms 30044 KB Correct
156 Correct 10 ms 30448 KB Correct
157 Correct 351 ms 88444 KB Correct
158 Correct 270 ms 46684 KB Correct
159 Correct 52 ms 37948 KB Correct
160 Correct 329 ms 88120 KB Correct
161 Correct 356 ms 91132 KB Correct
162 Correct 176 ms 41556 KB Correct
163 Correct 312 ms 90724 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 28764 KB Correct
2 Correct 4 ms 28764 KB Correct
3 Correct 5 ms 29016 KB Correct
4 Correct 4 ms 28764 KB Correct
5 Correct 5 ms 28764 KB Correct
6 Correct 4 ms 29000 KB Correct
7 Correct 4 ms 28760 KB Correct
8 Correct 4 ms 28764 KB Correct
9 Correct 4 ms 28760 KB Correct
10 Correct 79 ms 66396 KB Correct
11 Correct 77 ms 65944 KB Correct
12 Correct 73 ms 60620 KB Correct
13 Correct 60 ms 60992 KB Correct
14 Correct 86 ms 66336 KB Correct
15 Correct 83 ms 66680 KB Correct
16 Correct 89 ms 66448 KB Correct
17 Correct 63 ms 66452 KB Correct
18 Correct 63 ms 67136 KB Correct
19 Correct 57 ms 66372 KB Correct
20 Correct 83 ms 66372 KB Correct
21 Correct 87 ms 66484 KB Correct
22 Correct 86 ms 65796 KB Correct
23 Correct 81 ms 60680 KB Correct
24 Correct 56 ms 61008 KB Correct
25 Correct 77 ms 66336 KB Correct
26 Correct 81 ms 66656 KB Correct
27 Correct 93 ms 66424 KB Correct
28 Correct 64 ms 66520 KB Correct
29 Correct 61 ms 67012 KB Correct
30 Correct 58 ms 66372 KB Correct
31 Correct 59 ms 66372 KB Correct
32 Correct 95 ms 69216 KB Correct
33 Correct 72 ms 65360 KB Correct
34 Correct 82 ms 66704 KB Correct
35 Correct 4 ms 28764 KB Correct
36 Correct 4 ms 28972 KB Correct
37 Correct 4 ms 28764 KB Correct
38 Correct 4 ms 28764 KB Correct
39 Correct 4 ms 28764 KB Correct
40 Correct 5 ms 28764 KB Correct
41 Correct 4 ms 28764 KB Correct
42 Correct 82 ms 66480 KB Correct
43 Correct 78 ms 65944 KB Correct
44 Correct 73 ms 60616 KB Correct
45 Correct 61 ms 61008 KB Correct
46 Correct 76 ms 66276 KB Correct
47 Correct 82 ms 66680 KB Correct
48 Correct 83 ms 66508 KB Correct
49 Correct 70 ms 66340 KB Correct
50 Correct 59 ms 67140 KB Correct
51 Correct 56 ms 66444 KB Correct
52 Correct 57 ms 66336 KB Correct
53 Correct 87 ms 69144 KB Correct
54 Correct 73 ms 65364 KB Correct
55 Correct 83 ms 66700 KB Correct
56 Correct 49 ms 52476 KB Correct
57 Correct 5 ms 29784 KB Correct
58 Correct 5 ms 28764 KB Correct
59 Correct 8 ms 29276 KB Correct
60 Correct 7 ms 29020 KB Correct
61 Correct 8 ms 30196 KB Correct
62 Correct 6 ms 30500 KB Correct
63 Correct 7 ms 30556 KB Correct
64 Correct 7 ms 30196 KB Correct
65 Correct 8 ms 30044 KB Correct
66 Correct 7 ms 30044 KB Correct
67 Correct 8 ms 30300 KB Correct
68 Correct 8 ms 30300 KB Correct
69 Correct 7 ms 30632 KB Correct
70 Correct 10 ms 30556 KB Correct
71 Correct 7 ms 30556 KB Correct
72 Correct 4 ms 28764 KB Correct
73 Correct 8 ms 29276 KB Correct
74 Correct 8 ms 29020 KB Correct
75 Correct 7 ms 30196 KB Correct
76 Correct 6 ms 30300 KB Correct
77 Correct 9 ms 30556 KB Correct
78 Correct 8 ms 30196 KB Correct
79 Correct 9 ms 30044 KB Correct
80 Correct 7 ms 30044 KB Correct
81 Correct 8 ms 30348 KB Correct
82 Correct 7 ms 30312 KB Correct
83 Correct 8 ms 30556 KB Correct
84 Correct 7 ms 30556 KB Correct
85 Correct 6 ms 30556 KB Correct
86 Correct 9 ms 29276 KB Correct
87 Correct 8 ms 30420 KB Correct
88 Correct 8 ms 30044 KB Correct
89 Correct 9 ms 30464 KB Correct
90 Correct 5 ms 28764 KB Correct
91 Correct 8 ms 29276 KB Correct
92 Correct 7 ms 29204 KB Correct
93 Correct 7 ms 30140 KB Correct
94 Correct 8 ms 30500 KB Correct
95 Correct 8 ms 30556 KB Correct
96 Correct 7 ms 30196 KB Correct
97 Correct 8 ms 30044 KB Correct
98 Correct 8 ms 30092 KB Correct
99 Correct 7 ms 30300 KB Correct
100 Correct 7 ms 30300 KB Correct
101 Correct 7 ms 30556 KB Correct
102 Correct 7 ms 30556 KB Correct
103 Correct 8 ms 30556 KB Correct
104 Correct 8 ms 29276 KB Correct
105 Correct 8 ms 30420 KB Correct
106 Correct 8 ms 30044 KB Correct
107 Correct 8 ms 30300 KB Correct
108 Correct 4 ms 28764 KB Correct
109 Correct 4 ms 29000 KB Correct
110 Correct 4 ms 28764 KB Correct
111 Correct 4 ms 28764 KB Correct
112 Correct 4 ms 28900 KB Correct
113 Correct 4 ms 28764 KB Correct
114 Correct 5 ms 28764 KB Correct
115 Correct 14 ms 30556 KB Correct
116 Correct 14 ms 30264 KB Correct
117 Correct 9 ms 30300 KB Correct
118 Correct 9 ms 30556 KB Correct
119 Correct 82 ms 66520 KB Correct
120 Correct 78 ms 65944 KB Correct
121 Correct 94 ms 60432 KB Correct
122 Correct 55 ms 60992 KB Correct
123 Correct 80 ms 66272 KB Correct
124 Correct 90 ms 66684 KB Correct
125 Correct 90 ms 66612 KB Correct
126 Correct 67 ms 66452 KB Correct
127 Correct 65 ms 66964 KB Correct
128 Correct 59 ms 66372 KB Correct
129 Correct 59 ms 66372 KB Correct
130 Correct 5 ms 28760 KB Correct
131 Correct 10 ms 29276 KB Correct
132 Correct 7 ms 29020 KB Correct
133 Correct 8 ms 30196 KB Correct
134 Correct 7 ms 30300 KB Correct
135 Correct 7 ms 30556 KB Correct
136 Correct 7 ms 30248 KB Correct
137 Correct 8 ms 30040 KB Correct
138 Correct 9 ms 30040 KB Correct
139 Correct 9 ms 30300 KB Correct
140 Correct 6 ms 30300 KB Correct
141 Correct 6 ms 30556 KB Correct
142 Correct 7 ms 30556 KB Correct
143 Correct 7 ms 30556 KB Correct
144 Correct 383 ms 86376 KB Correct
145 Correct 297 ms 45368 KB Correct
146 Correct 68 ms 31316 KB Correct
147 Correct 110 ms 42904 KB Correct
148 Correct 204 ms 43348 KB Correct
149 Correct 330 ms 82724 KB Correct
150 Correct 375 ms 87380 KB Correct
151 Correct 185 ms 41556 KB Correct
152 Correct 150 ms 39252 KB Correct
153 Correct 266 ms 78752 KB Correct
154 Correct 330 ms 82672 KB Correct
155 Correct 154 ms 85432 KB Correct
156 Correct 160 ms 85564 KB Correct
157 Correct 145 ms 84608 KB Correct
158 Correct 152 ms 85248 KB Correct
159 Correct 133 ms 85388 KB Correct
160 Correct 159 ms 84964 KB Correct
161 Correct 153 ms 83180 KB Correct
162 Correct 135 ms 83328 KB Correct
163 Correct 151 ms 74576 KB Correct
164 Correct 156 ms 74744 KB Correct
165 Correct 85 ms 66540 KB Correct
166 Correct 76 ms 65944 KB Correct
167 Correct 80 ms 61576 KB Correct
168 Correct 61 ms 61264 KB Correct
169 Correct 98 ms 66276 KB Correct
170 Correct 87 ms 67704 KB Correct
171 Correct 86 ms 67756 KB Correct
172 Correct 73 ms 67476 KB Correct
173 Correct 63 ms 66992 KB Correct
174 Correct 57 ms 66904 KB Correct
175 Correct 64 ms 67392 KB Correct
176 Correct 4 ms 28760 KB Correct
177 Correct 9 ms 29404 KB Correct
178 Correct 7 ms 29020 KB Correct
179 Correct 8 ms 30196 KB Correct
180 Correct 6 ms 30388 KB Correct
181 Correct 7 ms 30672 KB Correct
182 Correct 7 ms 30192 KB Correct
183 Correct 7 ms 30044 KB Correct
184 Correct 8 ms 29900 KB Correct
185 Correct 8 ms 30300 KB Correct
186 Correct 8 ms 30264 KB Correct
187 Correct 7 ms 30728 KB Correct
188 Correct 7 ms 30556 KB Correct
189 Correct 7 ms 30556 KB Correct
190 Correct 331 ms 87904 KB Correct
191 Correct 283 ms 44876 KB Correct
192 Correct 42 ms 31312 KB Correct
193 Correct 95 ms 42944 KB Correct
194 Correct 213 ms 43092 KB Correct
195 Correct 272 ms 83688 KB Correct
196 Correct 348 ms 89424 KB Correct
197 Correct 167 ms 41608 KB Correct
198 Correct 141 ms 39364 KB Correct
199 Correct 231 ms 79320 KB Correct
200 Correct 302 ms 79748 KB Correct
201 Correct 130 ms 84620 KB Correct
202 Correct 142 ms 85640 KB Correct
203 Correct 126 ms 85048 KB Correct
204 Correct 135 ms 84504 KB Correct
205 Correct 138 ms 85100 KB Correct
206 Correct 126 ms 85472 KB Correct
207 Correct 135 ms 85244 KB Correct
208 Correct 139 ms 85116 KB Correct
209 Correct 155 ms 77412 KB Correct
210 Correct 156 ms 77560 KB Correct
211 Correct 86 ms 69144 KB Correct
212 Correct 75 ms 65360 KB Correct
213 Correct 89 ms 67724 KB Correct
214 Correct 8 ms 29276 KB Correct
215 Correct 8 ms 30384 KB Correct
216 Correct 8 ms 30044 KB Correct
217 Correct 10 ms 30448 KB Correct
218 Correct 351 ms 88444 KB Correct
219 Correct 270 ms 46684 KB Correct
220 Correct 52 ms 37948 KB Correct
221 Correct 329 ms 88120 KB Correct
222 Correct 356 ms 91132 KB Correct
223 Correct 176 ms 41556 KB Correct
224 Correct 312 ms 90724 KB Correct
225 Correct 79 ms 67604 KB Correct
226 Correct 84 ms 66896 KB Correct
227 Correct 76 ms 61448 KB Correct
228 Correct 56 ms 61268 KB Correct
229 Correct 80 ms 67420 KB Correct
230 Correct 80 ms 67784 KB Correct
231 Correct 82 ms 67708 KB Correct
232 Correct 63 ms 66452 KB Correct
233 Correct 63 ms 68036 KB Correct
234 Correct 62 ms 67540 KB Correct
235 Correct 64 ms 67392 KB Correct
236 Correct 4 ms 28764 KB Correct
237 Correct 8 ms 29532 KB Correct
238 Correct 7 ms 29020 KB Correct
239 Correct 7 ms 30196 KB Correct
240 Correct 6 ms 30500 KB Correct
241 Correct 8 ms 30660 KB Correct
242 Correct 8 ms 30300 KB Correct
243 Correct 8 ms 30040 KB Correct
244 Correct 8 ms 30044 KB Correct
245 Correct 8 ms 30296 KB Correct
246 Correct 8 ms 30356 KB Correct
247 Correct 8 ms 30728 KB Correct
248 Correct 7 ms 30556 KB Correct
249 Correct 10 ms 30700 KB Correct
250 Correct 324 ms 88036 KB Correct
251 Correct 259 ms 45264 KB Correct
252 Correct 35 ms 31008 KB Correct
253 Correct 83 ms 42008 KB Correct
254 Correct 205 ms 41504 KB Correct
255 Correct 267 ms 81004 KB Correct
256 Correct 318 ms 86764 KB Correct
257 Correct 173 ms 40272 KB Correct
258 Correct 137 ms 38148 KB Correct
259 Correct 219 ms 78036 KB Correct
260 Correct 277 ms 80028 KB Correct
261 Correct 148 ms 85348 KB Correct
262 Correct 125 ms 85560 KB Correct
263 Correct 137 ms 84448 KB Correct
264 Correct 142 ms 85388 KB Correct
265 Correct 123 ms 84100 KB Correct
266 Correct 126 ms 83172 KB Correct
267 Correct 143 ms 84228 KB Correct
268 Correct 124 ms 85108 KB Correct
269 Correct 156 ms 75104 KB Correct
270 Correct 153 ms 77092 KB Correct
271 Correct 85 ms 70388 KB Correct
272 Correct 76 ms 65872 KB Correct
273 Correct 86 ms 67960 KB Correct
274 Correct 8 ms 29272 KB Correct
275 Correct 7 ms 30420 KB Correct
276 Correct 9 ms 30188 KB Correct
277 Correct 8 ms 30556 KB Correct
278 Correct 370 ms 91212 KB Correct
279 Correct 267 ms 48420 KB Correct
280 Correct 56 ms 38204 KB Correct
281 Correct 359 ms 90948 KB Correct
282 Correct 323 ms 91116 KB Correct
283 Correct 166 ms 41808 KB Correct
284 Correct 302 ms 91088 KB Correct
285 Correct 4 ms 28760 KB Correct
286 Correct 5 ms 28760 KB Correct
287 Correct 4 ms 28764 KB Correct
288 Correct 4 ms 28764 KB Correct
289 Correct 4 ms 28764 KB Correct
290 Correct 4 ms 28880 KB Correct
291 Correct 5 ms 28764 KB Correct
292 Correct 47 ms 52684 KB Correct
293 Correct 5 ms 29784 KB Correct
294 Correct 13 ms 30612 KB Correct
295 Correct 15 ms 30236 KB Correct
296 Correct 10 ms 30296 KB Correct
297 Correct 9 ms 30556 KB Correct
298 Correct 382 ms 92712 KB Correct
299 Correct 387 ms 54728 KB Correct
300 Correct 188 ms 40568 KB Correct
301 Correct 201 ms 40228 KB Correct
302 Correct 167 ms 40272 KB Correct
303 Correct 341 ms 90984 KB Correct
304 Correct 328 ms 95488 KB Correct
305 Correct 329 ms 95284 KB Correct
306 Correct 323 ms 81884 KB Correct
307 Correct 287 ms 83520 KB Correct