답안 #1095368

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1095368 2024-10-02T02:08:42 Z raphaelp Team Coding (EGOI24_teamcoding) C++14
100 / 100
2341 ms 62672 KB
#include <bits/stdc++.h>
using namespace std;
void dfs(long long x, vector<vector<long long>> &AR, vector<long long> &depth, long long cur)
{
    depth[x] = cur;
    for (long long i = 0; i < AR[x].size(); i++)
    {
        dfs(AR[x][i], AR, depth, cur + 1);
    }
}
void dfs2(long long x, vector<vector<long long>> &AR, vector<vector<pair<long long, long long>>> &colorpos, vector<long long> &available, map<long long, long long> &M, vector<long long> &C, vector<vector<long long>> &colors, long long cur, long long &best, long long &best2)
{
    available.push_back(1);
    vector<long long> available2;
    map<long long, long long> M2;
    M[C[x]] += 1;
    for (long long i = 0; i < AR[x].size(); i++)
    {
        available2.clear();
        M2.clear();
        dfs2(AR[x][i], AR, colorpos, available2, M2, C, colors, cur + 1, best, best2);
        available2.push_back(0);
        if (available2.size() > available.size())
            swap(available2, available);
        for (long long j = 0; j < available2.size(); j++)
        {
            available[j + available.size() - available2.size()] += available2[j];
        }
        if (M2.size() > M.size())
            swap(M, M2);
        for (auto j : M2)
        {
            M[j.first] += j.second;
        }
    }
    if (colors[C[x]].size() <= sqrt(AR.size()))
    {
        long long ans1 = 0, ans2 = 0;
        for (long long i = 0; i < colorpos[C[x]].size(); i++)
        {
            if (colorpos[C[x]][i].first >= cur && colorpos[C[x]][i].first < cur + available.size())
                ans1 += min(colorpos[C[x]][i].second, available[available.size() - colorpos[C[x]][i].first - 1 + cur]);
        }
        ans2 = ans1 - M[C[x]];
        if (ans1 > best || (ans1 == best && ans2 < best2))
        {
            best = ans1, best2 = ans2;
        }
    }
}
pair<long long, long long> dfs3(long long x, vector<vector<long long>> &AR, vector<long long> &C, long long c, vector<long long> &used, vector<long long> &maxx, long long cur, long long &best, long long &best2)
{
    vector<long long> used2;
    long long tot = 0, tot2 = 0;
    if (C[x] == c)
        tot2++;
    used.push_back(0);
    if (maxx[cur] != 0)
    {
        used[0] = 1;
        tot++;
    }
    for (long long i = 0; i < AR[x].size(); i++)
    {
        used2.clear();
        pair<long long, long long> temp = dfs3(AR[x][i], AR, C, c, used2, maxx, cur + 1, best, best2);
        tot2 += temp.second;
        used2.push_back(0);
        if (used2.size() > used.size())
        {
            swap(used2, used);
            swap(tot, temp.first);
        }
        for (long long j = 0; j < used2.size(); j++)
        {
            tot -= used[j + used.size() - used2.size()];
            used[j + used.size() - used2.size()] = min(used[j + used.size() - used2.size()] + used2[j], maxx[cur + used2.size() - j - 1]);
            tot += used[j + used.size() - used2.size()];
        }
    }
    if (C[x] == c && (tot > best || (tot == best && tot - tot2 < best2)))
    {
        best = tot, best2 = tot - tot2;
    }
    return {tot, tot2};
}
int main()
{
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(0);
    long long N, K;
    cin >> N >> K;
    vector<long long> C(N);
    vector<vector<long long>> colors(K);
    for (long long i = 0; i < N; i++)
    {
        cin >> C[i];
        colors[C[i]].push_back(i);
    }
    vector<long long> p(N, 0);
    vector<vector<long long>> AR(N);
    for (long long i = 1; i < N; i++)
    {
        cin >> p[i];
        AR[p[i]].push_back(i);
    }
    vector<long long> depth(N);
    vector<vector<pair<long long, long long>>> colorpos(K);
    dfs(0, AR, depth, 0);
    long long best = 0, best2 = 0;
    for (long long i = 0; i < K; i++)
    {
        for (long long j = 0; j < colors[i].size(); j++)
        {
            colorpos[i].push_back({depth[colors[i][j]], 1});
        }
        sort(colorpos[i].begin(), colorpos[i].end());
        vector<pair<long long, long long>> temp;
        long long cur = 0;
        for (long long j = 0; j < colors[i].size(); j++)
        {
            if (j > 0 && colorpos[i][j].first != colorpos[i][j - 1].first)
            {
                temp.push_back({colorpos[i][j - 1].first, cur});
                cur = 0;
            }
            cur++;
        }
        if (colors[i].size() > 0)
            temp.push_back({colorpos[i].back().first, cur});
        swap(temp, colorpos[i]);
    }
    vector<long long> available;
    map<long long, long long> M;
    dfs2(0, AR, colorpos, available, M, C, colors, 0, best, best2);
    for (long long i = 0; i < K; i++)
    {
        if (colors[i].size() >= sqrt(N) - 1)
        {
            vector<long long> used, maxx(N);
            for (long long j = 0; j < colors[i].size(); j++)
                maxx[depth[colors[i][j]]]++;
            pair<long long, long long> temp = dfs3(0, AR, C, i, used, maxx, 0, best, best2);
        }
    }
    cout << best << ' ' << best2;
}

Compilation message

Main.cpp: In function 'void dfs(long long int, std::vector<std::vector<long long int> >&, std::vector<long long int>&, long long int)':
Main.cpp:6:29: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    6 |     for (long long i = 0; i < AR[x].size(); i++)
      |                           ~~^~~~~~~~~~~~~~
Main.cpp: In function 'void dfs2(long long int, std::vector<std::vector<long long int> >&, std::vector<std::vector<std::pair<long long int, long long int> > >&, std::vector<long long int>&, std::map<long long int, long long int>&, std::vector<long long int>&, std::vector<std::vector<long long int> >&, long long int, long long int&, long long int&)':
Main.cpp:17:29: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |     for (long long i = 0; i < AR[x].size(); i++)
      |                           ~~^~~~~~~~~~~~~~
Main.cpp:25:33: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |         for (long long j = 0; j < available2.size(); j++)
      |                               ~~^~~~~~~~~~~~~~~~~~~
Main.cpp:39:33: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   39 |         for (long long i = 0; i < colorpos[C[x]].size(); i++)
      |                               ~~^~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:41:75: warning: comparison of integer expressions of different signedness: 'long long int' and 'long long unsigned int' [-Wsign-compare]
   41 |             if (colorpos[C[x]][i].first >= cur && colorpos[C[x]][i].first < cur + available.size())
Main.cpp: In function 'std::pair<long long int, long long int> dfs3(long long int, std::vector<std::vector<long long int> >&, std::vector<long long int>&, long long int, std::vector<long long int>&, std::vector<long long int>&, long long int, long long int&, long long int&)':
Main.cpp:63:29: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   63 |     for (long long i = 0; i < AR[x].size(); i++)
      |                           ~~^~~~~~~~~~~~~~
Main.cpp:74:33: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   74 |         for (long long j = 0; j < used2.size(); j++)
      |                               ~~^~~~~~~~~~~~~~
Main.cpp: In function 'int main()':
Main.cpp:114:33: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  114 |         for (long long j = 0; j < colors[i].size(); j++)
      |                               ~~^~~~~~~~~~~~~~~~~~
Main.cpp:121:33: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  121 |         for (long long j = 0; j < colors[i].size(); j++)
      |                               ~~^~~~~~~~~~~~~~~~~~
Main.cpp:142:37: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  142 |             for (long long j = 0; j < colors[i].size(); j++)
      |                                   ~~^~~~~~~~~~~~~~~~~~
Main.cpp:144:40: warning: variable 'temp' set but not used [-Wunused-but-set-variable]
  144 |             pair<long long, long long> temp = dfs3(0, AR, C, i, used, maxx, 0, best, best2);
      |                                        ^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 4 ms 1372 KB Output is correct
9 Correct 110 ms 60244 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 1372 KB Output is correct
12 Correct 79 ms 54496 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 2 ms 1628 KB Output is correct
15 Correct 117 ms 62672 KB Output is correct
16 Correct 0 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 2 ms 1372 KB Output is correct
5 Correct 71 ms 54452 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 604 KB Output is correct
8 Correct 34 ms 10032 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 1 ms 860 KB Output is correct
11 Correct 72 ms 32444 KB Output is correct
12 Correct 19 ms 8924 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 49 ms 9400 KB Output is correct
16 Correct 51 ms 9640 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 604 KB Output is correct
19 Correct 58 ms 9996 KB Output is correct
20 Correct 59 ms 10004 KB Output is correct
21 Correct 49 ms 9880 KB Output is correct
22 Correct 0 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 110 ms 60292 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 2 ms 1628 KB Output is correct
11 Correct 113 ms 62672 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 2 ms 604 KB Output is correct
16 Correct 1 ms 604 KB Output is correct
17 Correct 1 ms 604 KB Output is correct
18 Correct 123 ms 19356 KB Output is correct
19 Correct 109 ms 17656 KB Output is correct
20 Correct 100 ms 24096 KB Output is correct
21 Correct 72 ms 11088 KB Output is correct
22 Correct 111 ms 20560 KB Output is correct
23 Correct 116 ms 39880 KB Output is correct
24 Correct 108 ms 30332 KB Output is correct
25 Correct 2 ms 860 KB Output is correct
26 Correct 2 ms 1116 KB Output is correct
27 Correct 3 ms 604 KB Output is correct
28 Correct 2 ms 644 KB Output is correct
29 Correct 10 ms 2396 KB Output is correct
30 Correct 111 ms 17788 KB Output is correct
31 Correct 125 ms 22352 KB Output is correct
32 Correct 108 ms 29264 KB Output is correct
33 Correct 86 ms 18080 KB Output is correct
34 Correct 1 ms 344 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 4 ms 1372 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 2 ms 1372 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 2 ms 1628 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 1 ms 604 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 860 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 1 ms 604 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 2 ms 604 KB Output is correct
24 Correct 2 ms 604 KB Output is correct
25 Correct 2 ms 604 KB Output is correct
26 Correct 1 ms 860 KB Output is correct
27 Correct 2 ms 1372 KB Output is correct
28 Correct 2 ms 604 KB Output is correct
29 Correct 2 ms 860 KB Output is correct
30 Correct 1 ms 1116 KB Output is correct
31 Correct 5 ms 604 KB Output is correct
32 Correct 1 ms 604 KB Output is correct
33 Correct 1 ms 604 KB Output is correct
34 Correct 1 ms 604 KB Output is correct
35 Correct 1 ms 604 KB Output is correct
36 Correct 2 ms 604 KB Output is correct
37 Correct 1 ms 604 KB Output is correct
38 Correct 1 ms 348 KB Output is correct
39 Correct 0 ms 348 KB Output is correct
40 Correct 1 ms 348 KB Output is correct
41 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 4 ms 1372 KB Output is correct
9 Correct 110 ms 60244 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 1372 KB Output is correct
12 Correct 79 ms 54496 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 2 ms 1628 KB Output is correct
15 Correct 117 ms 62672 KB Output is correct
16 Correct 0 ms 344 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 2 ms 1372 KB Output is correct
21 Correct 71 ms 54452 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 1 ms 604 KB Output is correct
24 Correct 34 ms 10032 KB Output is correct
25 Correct 0 ms 344 KB Output is correct
26 Correct 1 ms 860 KB Output is correct
27 Correct 72 ms 32444 KB Output is correct
28 Correct 19 ms 8924 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 49 ms 9400 KB Output is correct
32 Correct 51 ms 9640 KB Output is correct
33 Correct 1 ms 348 KB Output is correct
34 Correct 1 ms 604 KB Output is correct
35 Correct 58 ms 9996 KB Output is correct
36 Correct 59 ms 10004 KB Output is correct
37 Correct 49 ms 9880 KB Output is correct
38 Correct 0 ms 344 KB Output is correct
39 Correct 0 ms 348 KB Output is correct
40 Correct 0 ms 348 KB Output is correct
41 Correct 0 ms 348 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 0 ms 348 KB Output is correct
44 Correct 0 ms 348 KB Output is correct
45 Correct 0 ms 344 KB Output is correct
46 Correct 110 ms 60292 KB Output is correct
47 Correct 0 ms 344 KB Output is correct
48 Correct 2 ms 1628 KB Output is correct
49 Correct 113 ms 62672 KB Output is correct
50 Correct 1 ms 348 KB Output is correct
51 Correct 0 ms 348 KB Output is correct
52 Correct 0 ms 348 KB Output is correct
53 Correct 2 ms 604 KB Output is correct
54 Correct 1 ms 604 KB Output is correct
55 Correct 1 ms 604 KB Output is correct
56 Correct 123 ms 19356 KB Output is correct
57 Correct 109 ms 17656 KB Output is correct
58 Correct 100 ms 24096 KB Output is correct
59 Correct 72 ms 11088 KB Output is correct
60 Correct 111 ms 20560 KB Output is correct
61 Correct 116 ms 39880 KB Output is correct
62 Correct 108 ms 30332 KB Output is correct
63 Correct 2 ms 860 KB Output is correct
64 Correct 2 ms 1116 KB Output is correct
65 Correct 3 ms 604 KB Output is correct
66 Correct 2 ms 644 KB Output is correct
67 Correct 10 ms 2396 KB Output is correct
68 Correct 111 ms 17788 KB Output is correct
69 Correct 125 ms 22352 KB Output is correct
70 Correct 108 ms 29264 KB Output is correct
71 Correct 86 ms 18080 KB Output is correct
72 Correct 1 ms 344 KB Output is correct
73 Correct 0 ms 348 KB Output is correct
74 Correct 0 ms 348 KB Output is correct
75 Correct 0 ms 348 KB Output is correct
76 Correct 0 ms 344 KB Output is correct
77 Correct 0 ms 348 KB Output is correct
78 Correct 0 ms 348 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 0 ms 348 KB Output is correct
81 Correct 0 ms 348 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 4 ms 1372 KB Output is correct
84 Correct 0 ms 348 KB Output is correct
85 Correct 2 ms 1372 KB Output is correct
86 Correct 0 ms 348 KB Output is correct
87 Correct 2 ms 1628 KB Output is correct
88 Correct 0 ms 348 KB Output is correct
89 Correct 1 ms 604 KB Output is correct
90 Correct 0 ms 348 KB Output is correct
91 Correct 1 ms 860 KB Output is correct
92 Correct 0 ms 348 KB Output is correct
93 Correct 0 ms 348 KB Output is correct
94 Correct 0 ms 348 KB Output is correct
95 Correct 1 ms 604 KB Output is correct
96 Correct 0 ms 348 KB Output is correct
97 Correct 0 ms 348 KB Output is correct
98 Correct 2 ms 604 KB Output is correct
99 Correct 2 ms 604 KB Output is correct
100 Correct 2 ms 604 KB Output is correct
101 Correct 1 ms 860 KB Output is correct
102 Correct 2 ms 1372 KB Output is correct
103 Correct 2 ms 604 KB Output is correct
104 Correct 2 ms 860 KB Output is correct
105 Correct 1 ms 1116 KB Output is correct
106 Correct 5 ms 604 KB Output is correct
107 Correct 1 ms 604 KB Output is correct
108 Correct 1 ms 604 KB Output is correct
109 Correct 1 ms 604 KB Output is correct
110 Correct 1 ms 604 KB Output is correct
111 Correct 2 ms 604 KB Output is correct
112 Correct 1 ms 604 KB Output is correct
113 Correct 1 ms 348 KB Output is correct
114 Correct 0 ms 348 KB Output is correct
115 Correct 1 ms 348 KB Output is correct
116 Correct 0 ms 348 KB Output is correct
117 Correct 0 ms 348 KB Output is correct
118 Correct 0 ms 348 KB Output is correct
119 Correct 0 ms 344 KB Output is correct
120 Correct 0 ms 348 KB Output is correct
121 Correct 0 ms 348 KB Output is correct
122 Correct 0 ms 348 KB Output is correct
123 Correct 0 ms 348 KB Output is correct
124 Correct 7 ms 1572 KB Output is correct
125 Correct 108 ms 60312 KB Output is correct
126 Correct 0 ms 348 KB Output is correct
127 Correct 1 ms 1372 KB Output is correct
128 Correct 69 ms 54236 KB Output is correct
129 Correct 1 ms 344 KB Output is correct
130 Correct 2 ms 1628 KB Output is correct
131 Correct 105 ms 62640 KB Output is correct
132 Correct 0 ms 344 KB Output is correct
133 Correct 1 ms 600 KB Output is correct
134 Correct 34 ms 9924 KB Output is correct
135 Correct 0 ms 348 KB Output is correct
136 Correct 2 ms 860 KB Output is correct
137 Correct 74 ms 32360 KB Output is correct
138 Correct 20 ms 8928 KB Output is correct
139 Correct 0 ms 344 KB Output is correct
140 Correct 0 ms 348 KB Output is correct
141 Correct 51 ms 9536 KB Output is correct
142 Correct 51 ms 9376 KB Output is correct
143 Correct 0 ms 344 KB Output is correct
144 Correct 1 ms 604 KB Output is correct
145 Correct 52 ms 9924 KB Output is correct
146 Correct 53 ms 10000 KB Output is correct
147 Correct 53 ms 9880 KB Output is correct
148 Correct 1 ms 348 KB Output is correct
149 Correct 0 ms 348 KB Output is correct
150 Correct 2 ms 604 KB Output is correct
151 Correct 1 ms 604 KB Output is correct
152 Correct 1 ms 604 KB Output is correct
153 Correct 117 ms 19456 KB Output is correct
154 Correct 111 ms 17640 KB Output is correct
155 Correct 91 ms 24144 KB Output is correct
156 Correct 72 ms 11088 KB Output is correct
157 Correct 86 ms 20564 KB Output is correct
158 Correct 119 ms 39812 KB Output is correct
159 Correct 97 ms 30544 KB Output is correct
160 Correct 1 ms 860 KB Output is correct
161 Correct 2 ms 1372 KB Output is correct
162 Correct 2 ms 604 KB Output is correct
163 Correct 2 ms 860 KB Output is correct
164 Correct 10 ms 2396 KB Output is correct
165 Correct 113 ms 17960 KB Output is correct
166 Correct 116 ms 22324 KB Output is correct
167 Correct 104 ms 29116 KB Output is correct
168 Correct 88 ms 18256 KB Output is correct
169 Correct 2 ms 1116 KB Output is correct
170 Correct 4 ms 724 KB Output is correct
171 Correct 1 ms 604 KB Output is correct
172 Correct 1 ms 604 KB Output is correct
173 Correct 1 ms 604 KB Output is correct
174 Correct 1 ms 604 KB Output is correct
175 Correct 2 ms 604 KB Output is correct
176 Correct 1 ms 720 KB Output is correct
177 Correct 95 ms 41232 KB Output is correct
178 Correct 2341 ms 13060 KB Output is correct
179 Correct 85 ms 15188 KB Output is correct
180 Correct 5 ms 1624 KB Output is correct
181 Correct 52 ms 12864 KB Output is correct
182 Correct 5 ms 1372 KB Output is correct
183 Correct 3 ms 1372 KB Output is correct
184 Correct 6 ms 1728 KB Output is correct
185 Correct 3 ms 1116 KB Output is correct
186 Correct 57 ms 13568 KB Output is correct
187 Correct 35 ms 9672 KB Output is correct
188 Correct 62 ms 11636 KB Output is correct
189 Correct 37 ms 9276 KB Output is correct
190 Correct 41 ms 10088 KB Output is correct
191 Correct 32 ms 11752 KB Output is correct
192 Correct 5 ms 1372 KB Output is correct
193 Correct 58 ms 10808 KB Output is correct
194 Correct 40 ms 20684 KB Output is correct
195 Correct 1 ms 344 KB Output is correct
196 Correct 0 ms 348 KB Output is correct
197 Correct 0 ms 348 KB Output is correct
198 Correct 0 ms 348 KB Output is correct