Submission #768886

# Submission time Handle Problem Language Result Execution time Memory
768886 2023-06-28T20:12:23 Z danikoynov Council (JOI23_council) C++14
100 / 100
750 ms 365840 KB
/**
 ____ ____ ____ ____ ____ ____
||l |||e |||i |||n |||a |||d ||
||__|||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|/__\|

**/

#include<bits/stdc++.h>
#define endl '\n'

using namespace std;
typedef long long ll;

void speed()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}

const int maxn = 3e5 + 10, maxm = 21;
int n, m, imp[maxm], cnt[maxm];
bool a[maxn][maxm];
pair < int, int > dp[maxm][(1 << maxm)][2];
int val_mask[maxn], rev_mask[maxn];
void solve()
{

    cin >> n >> m;
    for (int i = 1; i <= n; i ++)
        for (int j = 0; j < m; j ++)
            cin >> a[i][j], cnt[j] += a[i][j];

    for (int mask = 0; mask < (1 << m); mask ++)
        for (int i = 0; i < m; i ++)
            dp[i][mask][0] = dp[i][mask][1] = {-1, -1};

    for (int i = 1; i <= n; i ++)
    {
        for (int j = 0; j < m; j ++)
        {
            val_mask[i] = (val_mask[i] + (1 << j) * a[i][j]);
            rev_mask[i] = (rev_mask[i] + (1 << j) * (1 - a[i][j]));

            ///cout << "mask " << rev_mask[i] << endl;

        }
        int mask = rev_mask[i];

        int val = __builtin_popcount(mask);
        if (dp[0][mask][0].second == i)
        {
            dp[0][mask][0].first = max(dp[0][mask][0].first, val);
        }
        else if (dp[0][mask][1].second == i)
        {
            dp[0][mask][1].first = max(dp[0][mask][1].first, val);
            if (dp[0][mask][0].first < dp[0][mask][1].first)
                swap(dp[0][mask][0], dp[0][mask][1]);
        }
        else if (val > dp[0][mask][0].first)
        {
            dp[0][mask][1] = dp[0][mask][0];
            dp[0][mask][0] = {val, i};
        }
        else if (val > dp[0][mask][1].first)
        {
            dp[0][mask][1] = {val, i};
        }

    }

    for (int mask = (1 << m) - 1; mask >= 0; mask --)
    {
        for (int bit = 0; bit < m; bit ++)
        {
            if ((mask & (1 << bit)) > 0)
                continue;
            int new_mask = (mask ^ (1 << bit));
            int val = dp[0][new_mask][0].first - 1, idx = dp[0][new_mask][0].second;
            if (dp[0][mask][0].second == idx)
            {
                if (val > dp[0][mask][0].first)
                    dp[0][mask][0].first = val;
            }
            else if (dp[0][mask][1].second == idx)
            {
                if (val > dp[0][mask][1].first)
                    dp[0][mask][1].first = val;
                if (dp[0][mask][0].first < dp[0][mask][1].first)
                    swap(dp[0][mask][0], dp[0][mask][1]);
            }
            else if (val > dp[0][mask][0].first)
            {
                dp[0][mask][1] = dp[0][mask][0];
                dp[0][mask][0] = {val, idx};
            }
            else if (val > dp[0][mask][1].first)
            {
                dp[0][mask][1] = {val, idx};
            }

            val = dp[0][new_mask][1].first - 1;
            idx = dp[0][new_mask][1].second;
            if (dp[0][mask][0].second == idx)
            {
                if (val > dp[0][mask][0].first)
                    dp[0][mask][0].first = val;
            }
            else if (dp[0][mask][1].second == idx)
            {
                if (val > dp[0][mask][1].first)
                    dp[0][mask][1].first = val;
                if (dp[0][mask][0].first < dp[0][mask][1].first)
                    swap(dp[0][mask][0], dp[0][mask][1]);
            }
            else if (val > dp[0][mask][0].first)
            {
                dp[0][mask][1] = dp[0][mask][0];
                dp[0][mask][0] = {val, idx};
            }
            else if (val > dp[0][mask][1].first)
            {
                dp[0][mask][1] = {val, idx};
            }
        }
    }
    /**int val = __builtin_popcount(rev_mask[i]);
    if (dp[0][rev_mask[i]][0].second == i)
    {
        dp[0][rev_mask[i]][0].first = max(dp[0][rev_mask[i]][0].first, val);
    }
    else if (dp[0][rev_mask[i]][1].second == i)
    {
        dp[0][rev_mask[i]][1].first = max(dp[0][rev_mask[i]][1].first, val);
        if (dp[0][rev_mask[i]][0].first < dp[0][rev_mask[i]][1].first)
            swap(dp[0][rev_mask[i]][0], dp[0][rev_mask[i]][1]);
    }
    else if (val > dp[0][rev_mask[i]][0].first)
    {
        dp[0][rev_mask[i]][1] = dp[0][rev_mask[i]][0];
        dp[0][rev_mask[i]][0] = {val, i};
    }
    else if (val > dp[0][rev_mask[i]][1].first)
    {
        dp[0][rev_mask[i]][1] = {val, i};
    }*/



    for (int i = 1; i <= m; i ++)
        for (int mask = 0; mask < (1 << m); mask ++)
        {
            dp[i][mask][0] = dp[i - 1][mask][0];
            dp[i][mask][1] = dp[i - 1][mask][1];
            if ((mask & (1 << (i - 1))) > 0)
            {
                int new_mask = (mask ^ (1 << (i - 1)));
                int val = dp[i - 1][new_mask][0].first, idx = dp[i - 1][new_mask][0].second;
                if (dp[i][mask][0].second == idx)
                {
                    if (val > dp[i][mask][0].first)
                        dp[i][mask][0].first = val;
                }
                else if (dp[i][mask][1].second == idx)
                {
                    if (val > dp[i][mask][1].first)
                        dp[i][mask][1].first = val;
                    if (dp[i][mask][0].first < dp[i][mask][1].first)
                        swap(dp[i][mask][0], dp[i][mask][1]);
                }
                else if (val > dp[i][mask][0].first)
                {
                    dp[i][mask][1] = dp[i][mask][0];
                    dp[i][mask][0] = {val, idx};
                }
                else if (val > dp[i][mask][1].first)
                {
                    dp[i][mask][1] = {val, idx};
                }

                val = dp[i - 1][new_mask][1].first;
                idx = dp[i - 1][new_mask][1].second;
                if (dp[i][mask][0].second == idx)
                {
                    if (val > dp[i][mask][0].first)
                        dp[i][mask][0].first = val;
                }
                else if (dp[i][mask][1].second == idx)
                {
                    if (val > dp[i][mask][1].first)
                        dp[i][mask][1].first = val;
                    if (dp[i][mask][0].first < dp[i][mask][1].first)
                        swap(dp[i][mask][0], dp[i][mask][1]);
                }
                else if (val > dp[i][mask][0].first)
                {
                    dp[i][mask][1] = dp[i][mask][0];
                    dp[i][mask][0] = {val, idx};
                }
                else if (val > dp[i][mask][1].first)
                {
                    dp[i][mask][1] = {val, idx};
                }

            }
            /// cout << "state " << i << " " << mask << " " << dp[i][mask][0] << " " << dp[i][mask][1] << endl;
        }

    for (int i = 1; i <= n; i ++)
    {
        int two = 0, one = 0, zero = 0;
        for (int j = 0; j < m; j ++)
        {
            if (cnt[j] >= n / 2 + 2)
                two |= (1 << j);
            else if (cnt[j] >= n / 2 + 1)
                one |= (1 << j);
            else if (cnt[j] >= n / 2)
                zero |= (1 << j);
        }

        int mask = 0, rev = 0;
        for (int j = m - 1; j >= 0; j --)
        {
            mask = mask * 2 + (a[i][j]);
            rev = rev * 2 + (1 - a[i][j]);
        }

        int ONE = two | (one & (rev));
        int ZERO = (one & (mask)) | (zero & (rev));

        /**cout << i << " : " << ONE << " : " << ZERO << endl;
        for (int bit = 0; bit < m; bit ++)
            if ((ZERO & (1 << bit)) > 0)
            cout << 1 << " ";
            else
                cout << 0 << " ";
            cout << endl;*/
        int best = dp[m][ZERO][0].first;
        int val = __builtin_popcount(ZERO & rev_mask[i]);
        if (val == best)
            best = dp[m][ZERO][1].first;
        ///cout << i << " : " << val << " " << best << endl;
        cout << __builtin_popcount(ONE) + best << endl;
        continue;
        int ans = 0;
        for (int p = 1; p <= n; p ++)
        {
            if (p == i)
                continue;
            ///cout << "here " << p << " " << ((rev_mask[p])) << endl;
            int cur = __builtin_popcount((rev_mask[p]) & ZERO);
            /**cout << "step " << p << endl;
                    for (int bit = 0; bit < m; bit ++)
            if ((rev_mask[p] & (1 << bit)) > 0)
            cout << 1 << " ";
            else
            cout << 0 << " ";
            cout << endl;*/
            if (cur > __builtin_popcount(ans))
                ans = ((rev_mask[p]) & ZERO);
            ///ans = max(ans, __builtin_popcount((~val_mask[p]) & zero));
        }

        ans |= ONE;
        cout << __builtin_popcount(ans) << endl;



    }

}

int main()
{
    speed();
    solve();
    return 0;
}

# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 1236 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 295 ms 345148 KB Output is correct
6 Correct 280 ms 345192 KB Output is correct
7 Correct 284 ms 345196 KB Output is correct
8 Correct 303 ms 345184 KB Output is correct
9 Correct 331 ms 345160 KB Output is correct
10 Correct 298 ms 345164 KB Output is correct
11 Correct 380 ms 345184 KB Output is correct
12 Correct 333 ms 345120 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 0 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 0 ms 340 KB Output is correct
22 Correct 1 ms 596 KB Output is correct
23 Correct 0 ms 340 KB Output is correct
24 Correct 0 ms 340 KB Output is correct
25 Correct 0 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 0 ms 468 KB Output is correct
30 Correct 1 ms 596 KB Output is correct
31 Correct 1 ms 596 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 0 ms 340 KB Output is correct
34 Correct 0 ms 340 KB Output is correct
35 Correct 0 ms 340 KB Output is correct
36 Correct 0 ms 340 KB Output is correct
37 Correct 0 ms 340 KB Output is correct
38 Correct 1 ms 468 KB Output is correct
39 Correct 1 ms 596 KB Output is correct
40 Correct 1 ms 596 KB Output is correct
41 Correct 4 ms 4244 KB Output is correct
42 Correct 4 ms 4180 KB Output is correct
43 Correct 4 ms 4180 KB Output is correct
44 Correct 4 ms 4180 KB Output is correct
45 Correct 4 ms 4180 KB Output is correct
46 Correct 34 ms 37284 KB Output is correct
47 Correct 33 ms 37324 KB Output is correct
48 Correct 35 ms 37400 KB Output is correct
49 Correct 33 ms 37400 KB Output is correct
50 Correct 35 ms 37344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 1236 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 295 ms 345148 KB Output is correct
6 Correct 280 ms 345192 KB Output is correct
7 Correct 284 ms 345196 KB Output is correct
8 Correct 303 ms 345184 KB Output is correct
9 Correct 331 ms 345160 KB Output is correct
10 Correct 298 ms 345164 KB Output is correct
11 Correct 380 ms 345184 KB Output is correct
12 Correct 333 ms 345120 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 0 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 0 ms 340 KB Output is correct
22 Correct 1 ms 596 KB Output is correct
23 Correct 0 ms 340 KB Output is correct
24 Correct 0 ms 340 KB Output is correct
25 Correct 0 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 0 ms 468 KB Output is correct
30 Correct 1 ms 596 KB Output is correct
31 Correct 1 ms 596 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 0 ms 340 KB Output is correct
34 Correct 0 ms 340 KB Output is correct
35 Correct 0 ms 340 KB Output is correct
36 Correct 0 ms 340 KB Output is correct
37 Correct 0 ms 340 KB Output is correct
38 Correct 1 ms 468 KB Output is correct
39 Correct 1 ms 596 KB Output is correct
40 Correct 1 ms 596 KB Output is correct
41 Correct 4 ms 4244 KB Output is correct
42 Correct 4 ms 4180 KB Output is correct
43 Correct 4 ms 4180 KB Output is correct
44 Correct 4 ms 4180 KB Output is correct
45 Correct 4 ms 4180 KB Output is correct
46 Correct 34 ms 37284 KB Output is correct
47 Correct 33 ms 37324 KB Output is correct
48 Correct 35 ms 37400 KB Output is correct
49 Correct 33 ms 37400 KB Output is correct
50 Correct 35 ms 37344 KB Output is correct
51 Correct 297 ms 345276 KB Output is correct
52 Correct 302 ms 345268 KB Output is correct
53 Correct 320 ms 345272 KB Output is correct
54 Correct 337 ms 345272 KB Output is correct
55 Correct 1 ms 340 KB Output is correct
56 Correct 44 ms 37500 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 54 ms 9384 KB Output is correct
3 Correct 59 ms 9400 KB Output is correct
4 Correct 39 ms 9320 KB Output is correct
5 Correct 55 ms 9388 KB Output is correct
6 Correct 48 ms 9420 KB Output is correct
7 Correct 58 ms 9376 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 0 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 54 ms 9384 KB Output is correct
3 Correct 59 ms 9400 KB Output is correct
4 Correct 39 ms 9320 KB Output is correct
5 Correct 55 ms 9388 KB Output is correct
6 Correct 48 ms 9420 KB Output is correct
7 Correct 58 ms 9376 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 0 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 0 ms 340 KB Output is correct
20 Correct 183 ms 9680 KB Output is correct
21 Correct 167 ms 9572 KB Output is correct
22 Correct 195 ms 9480 KB Output is correct
23 Correct 174 ms 9964 KB Output is correct
24 Correct 158 ms 9676 KB Output is correct
25 Correct 189 ms 9604 KB Output is correct
26 Correct 182 ms 9672 KB Output is correct
27 Correct 1 ms 596 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 0 ms 340 KB Output is correct
30 Correct 0 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 0 ms 340 KB Output is correct
34 Correct 1 ms 468 KB Output is correct
35 Correct 1 ms 596 KB Output is correct
36 Correct 1 ms 596 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Correct 0 ms 340 KB Output is correct
39 Correct 0 ms 340 KB Output is correct
40 Correct 0 ms 340 KB Output is correct
41 Correct 0 ms 340 KB Output is correct
42 Correct 0 ms 340 KB Output is correct
43 Correct 1 ms 468 KB Output is correct
44 Correct 1 ms 596 KB Output is correct
45 Correct 1 ms 596 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 54 ms 9384 KB Output is correct
3 Correct 59 ms 9400 KB Output is correct
4 Correct 39 ms 9320 KB Output is correct
5 Correct 55 ms 9388 KB Output is correct
6 Correct 48 ms 9420 KB Output is correct
7 Correct 58 ms 9376 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 0 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 0 ms 340 KB Output is correct
20 Correct 183 ms 9680 KB Output is correct
21 Correct 167 ms 9572 KB Output is correct
22 Correct 195 ms 9480 KB Output is correct
23 Correct 174 ms 9964 KB Output is correct
24 Correct 158 ms 9676 KB Output is correct
25 Correct 189 ms 9604 KB Output is correct
26 Correct 182 ms 9672 KB Output is correct
27 Correct 1 ms 596 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 0 ms 340 KB Output is correct
30 Correct 0 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 0 ms 340 KB Output is correct
34 Correct 1 ms 468 KB Output is correct
35 Correct 1 ms 596 KB Output is correct
36 Correct 1 ms 596 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Correct 0 ms 340 KB Output is correct
39 Correct 0 ms 340 KB Output is correct
40 Correct 0 ms 340 KB Output is correct
41 Correct 0 ms 340 KB Output is correct
42 Correct 0 ms 340 KB Output is correct
43 Correct 1 ms 468 KB Output is correct
44 Correct 1 ms 596 KB Output is correct
45 Correct 1 ms 596 KB Output is correct
46 Correct 1 ms 1236 KB Output is correct
47 Correct 246 ms 13312 KB Output is correct
48 Correct 233 ms 11400 KB Output is correct
49 Correct 232 ms 11312 KB Output is correct
50 Correct 235 ms 13604 KB Output is correct
51 Correct 224 ms 13392 KB Output is correct
52 Correct 257 ms 20044 KB Output is correct
53 Correct 257 ms 20936 KB Output is correct
54 Correct 4 ms 4180 KB Output is correct
55 Correct 4 ms 4300 KB Output is correct
56 Correct 4 ms 4180 KB Output is correct
57 Correct 5 ms 4180 KB Output is correct
58 Correct 5 ms 4180 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 54 ms 9384 KB Output is correct
3 Correct 59 ms 9400 KB Output is correct
4 Correct 39 ms 9320 KB Output is correct
5 Correct 55 ms 9388 KB Output is correct
6 Correct 48 ms 9420 KB Output is correct
7 Correct 58 ms 9376 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 0 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 0 ms 340 KB Output is correct
20 Correct 183 ms 9680 KB Output is correct
21 Correct 167 ms 9572 KB Output is correct
22 Correct 195 ms 9480 KB Output is correct
23 Correct 174 ms 9964 KB Output is correct
24 Correct 158 ms 9676 KB Output is correct
25 Correct 189 ms 9604 KB Output is correct
26 Correct 182 ms 9672 KB Output is correct
27 Correct 1 ms 596 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 0 ms 340 KB Output is correct
30 Correct 0 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 0 ms 340 KB Output is correct
34 Correct 1 ms 468 KB Output is correct
35 Correct 1 ms 596 KB Output is correct
36 Correct 1 ms 596 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Correct 0 ms 340 KB Output is correct
39 Correct 0 ms 340 KB Output is correct
40 Correct 0 ms 340 KB Output is correct
41 Correct 0 ms 340 KB Output is correct
42 Correct 0 ms 340 KB Output is correct
43 Correct 1 ms 468 KB Output is correct
44 Correct 1 ms 596 KB Output is correct
45 Correct 1 ms 596 KB Output is correct
46 Correct 1 ms 1236 KB Output is correct
47 Correct 246 ms 13312 KB Output is correct
48 Correct 233 ms 11400 KB Output is correct
49 Correct 232 ms 11312 KB Output is correct
50 Correct 235 ms 13604 KB Output is correct
51 Correct 224 ms 13392 KB Output is correct
52 Correct 257 ms 20044 KB Output is correct
53 Correct 257 ms 20936 KB Output is correct
54 Correct 4 ms 4180 KB Output is correct
55 Correct 4 ms 4300 KB Output is correct
56 Correct 4 ms 4180 KB Output is correct
57 Correct 5 ms 4180 KB Output is correct
58 Correct 5 ms 4180 KB Output is correct
59 Correct 301 ms 35448 KB Output is correct
60 Correct 157 ms 44340 KB Output is correct
61 Correct 156 ms 44640 KB Output is correct
62 Correct 166 ms 44876 KB Output is correct
63 Correct 298 ms 35092 KB Output is correct
64 Correct 366 ms 55084 KB Output is correct
65 Correct 338 ms 55176 KB Output is correct
66 Correct 310 ms 55492 KB Output is correct
67 Correct 288 ms 55108 KB Output is correct
68 Correct 336 ms 55016 KB Output is correct
69 Correct 342 ms 55664 KB Output is correct
70 Correct 33 ms 37404 KB Output is correct
71 Correct 32 ms 37324 KB Output is correct
72 Correct 34 ms 37308 KB Output is correct
73 Correct 33 ms 37324 KB Output is correct
74 Correct 35 ms 37408 KB Output is correct
75 Correct 44 ms 37564 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 1236 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 295 ms 345148 KB Output is correct
6 Correct 280 ms 345192 KB Output is correct
7 Correct 284 ms 345196 KB Output is correct
8 Correct 303 ms 345184 KB Output is correct
9 Correct 331 ms 345160 KB Output is correct
10 Correct 298 ms 345164 KB Output is correct
11 Correct 380 ms 345184 KB Output is correct
12 Correct 333 ms 345120 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 0 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 0 ms 340 KB Output is correct
22 Correct 1 ms 596 KB Output is correct
23 Correct 0 ms 340 KB Output is correct
24 Correct 0 ms 340 KB Output is correct
25 Correct 0 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 0 ms 468 KB Output is correct
30 Correct 1 ms 596 KB Output is correct
31 Correct 1 ms 596 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 0 ms 340 KB Output is correct
34 Correct 0 ms 340 KB Output is correct
35 Correct 0 ms 340 KB Output is correct
36 Correct 0 ms 340 KB Output is correct
37 Correct 0 ms 340 KB Output is correct
38 Correct 1 ms 468 KB Output is correct
39 Correct 1 ms 596 KB Output is correct
40 Correct 1 ms 596 KB Output is correct
41 Correct 4 ms 4244 KB Output is correct
42 Correct 4 ms 4180 KB Output is correct
43 Correct 4 ms 4180 KB Output is correct
44 Correct 4 ms 4180 KB Output is correct
45 Correct 4 ms 4180 KB Output is correct
46 Correct 34 ms 37284 KB Output is correct
47 Correct 33 ms 37324 KB Output is correct
48 Correct 35 ms 37400 KB Output is correct
49 Correct 33 ms 37400 KB Output is correct
50 Correct 35 ms 37344 KB Output is correct
51 Correct 297 ms 345276 KB Output is correct
52 Correct 302 ms 345268 KB Output is correct
53 Correct 320 ms 345272 KB Output is correct
54 Correct 337 ms 345272 KB Output is correct
55 Correct 1 ms 340 KB Output is correct
56 Correct 44 ms 37500 KB Output is correct
57 Correct 0 ms 340 KB Output is correct
58 Correct 54 ms 9384 KB Output is correct
59 Correct 59 ms 9400 KB Output is correct
60 Correct 39 ms 9320 KB Output is correct
61 Correct 55 ms 9388 KB Output is correct
62 Correct 48 ms 9420 KB Output is correct
63 Correct 58 ms 9376 KB Output is correct
64 Correct 0 ms 340 KB Output is correct
65 Correct 0 ms 340 KB Output is correct
66 Correct 0 ms 340 KB Output is correct
67 Correct 1 ms 340 KB Output is correct
68 Correct 1 ms 340 KB Output is correct
69 Correct 0 ms 340 KB Output is correct
70 Correct 0 ms 340 KB Output is correct
71 Correct 0 ms 340 KB Output is correct
72 Correct 0 ms 340 KB Output is correct
73 Correct 1 ms 340 KB Output is correct
74 Correct 1 ms 340 KB Output is correct
75 Correct 0 ms 340 KB Output is correct
76 Correct 183 ms 9680 KB Output is correct
77 Correct 167 ms 9572 KB Output is correct
78 Correct 195 ms 9480 KB Output is correct
79 Correct 174 ms 9964 KB Output is correct
80 Correct 158 ms 9676 KB Output is correct
81 Correct 189 ms 9604 KB Output is correct
82 Correct 182 ms 9672 KB Output is correct
83 Correct 1 ms 596 KB Output is correct
84 Correct 0 ms 340 KB Output is correct
85 Correct 0 ms 340 KB Output is correct
86 Correct 0 ms 340 KB Output is correct
87 Correct 1 ms 340 KB Output is correct
88 Correct 0 ms 340 KB Output is correct
89 Correct 0 ms 340 KB Output is correct
90 Correct 1 ms 468 KB Output is correct
91 Correct 1 ms 596 KB Output is correct
92 Correct 1 ms 596 KB Output is correct
93 Correct 1 ms 340 KB Output is correct
94 Correct 0 ms 340 KB Output is correct
95 Correct 0 ms 340 KB Output is correct
96 Correct 0 ms 340 KB Output is correct
97 Correct 0 ms 340 KB Output is correct
98 Correct 0 ms 340 KB Output is correct
99 Correct 1 ms 468 KB Output is correct
100 Correct 1 ms 596 KB Output is correct
101 Correct 1 ms 596 KB Output is correct
102 Correct 1 ms 1236 KB Output is correct
103 Correct 246 ms 13312 KB Output is correct
104 Correct 233 ms 11400 KB Output is correct
105 Correct 232 ms 11312 KB Output is correct
106 Correct 235 ms 13604 KB Output is correct
107 Correct 224 ms 13392 KB Output is correct
108 Correct 257 ms 20044 KB Output is correct
109 Correct 257 ms 20936 KB Output is correct
110 Correct 4 ms 4180 KB Output is correct
111 Correct 4 ms 4300 KB Output is correct
112 Correct 4 ms 4180 KB Output is correct
113 Correct 5 ms 4180 KB Output is correct
114 Correct 5 ms 4180 KB Output is correct
115 Correct 301 ms 35448 KB Output is correct
116 Correct 157 ms 44340 KB Output is correct
117 Correct 156 ms 44640 KB Output is correct
118 Correct 166 ms 44876 KB Output is correct
119 Correct 298 ms 35092 KB Output is correct
120 Correct 366 ms 55084 KB Output is correct
121 Correct 338 ms 55176 KB Output is correct
122 Correct 310 ms 55492 KB Output is correct
123 Correct 288 ms 55108 KB Output is correct
124 Correct 336 ms 55016 KB Output is correct
125 Correct 342 ms 55664 KB Output is correct
126 Correct 33 ms 37404 KB Output is correct
127 Correct 32 ms 37324 KB Output is correct
128 Correct 34 ms 37308 KB Output is correct
129 Correct 33 ms 37324 KB Output is correct
130 Correct 35 ms 37408 KB Output is correct
131 Correct 44 ms 37564 KB Output is correct
132 Correct 672 ms 364544 KB Output is correct
133 Correct 668 ms 364708 KB Output is correct
134 Correct 665 ms 365260 KB Output is correct
135 Correct 713 ms 365160 KB Output is correct
136 Correct 709 ms 364748 KB Output is correct
137 Correct 495 ms 184012 KB Output is correct
138 Correct 493 ms 184688 KB Output is correct
139 Correct 609 ms 365380 KB Output is correct
140 Correct 589 ms 364656 KB Output is correct
141 Correct 737 ms 364600 KB Output is correct
142 Correct 750 ms 365840 KB Output is correct