Submission #569817

# Submission time Handle Problem Language Result Execution time Memory
569817 2022-05-27T20:37:55 Z aryan12 Painting Walls (APIO20_paint) C++17
100 / 100
1249 ms 15100 KB
#include "paint.h"
#include <bits/stdc++.h>
using namespace std;

int minimumInstructions(int N, int M, int K, vector<int> colors, vector<int> num, vector<vector<int> > likes) 
{
    vector<vector<int> > dp(2, vector<int> (M, -1e9));
    vector<int> likings[K];
    for(int contractor = 0; contractor < M; contractor++)
    {
        for(int j = 0; j < num[contractor]; j++)
        {
            likings[likes[contractor][j]].push_back(contractor);
        }
    }
    vector<int> start_pos;
    for(int i = N - 1; i >= 0; i--)
    {
        if(i <= N - 3)
        {
            for(int j = 0; j < likings[colors[i + 2]].size(); j++)
            {
                dp[i % 2][likings[colors[i + 2]][j]] = -1e9;
            }
        }
        int omk_cur = i % 2, omk_prev = (i + 1) % 2;
        bool flag = false;
        for(int j = 0; j < likings[colors[i]].size(); j++)
        {
            int cur = likings[colors[i]][j];
            if(i == N - 1 || dp[omk_prev][(cur + 1) % M] == -1e9)
            {
                dp[omk_cur][cur] = 1;
            }
            else
            {
                dp[omk_cur][cur] = dp[omk_prev][(cur + 1) % M] + 1;
            }
            if(dp[omk_cur][cur] >= M && i <= N - M && !flag)
            {
                start_pos.push_back(i);
                flag = true;
            }
        }
        // for(int j = 0; j < M; j++)
        // {
        //     if(likings[j].count(colors[i]))
        //     {
        //         if(i == N - 1 || dp[i + 1][(j + 1) % M] == -1e9)
        //         {
        //             dp[i][j] = 1;
        //         }
        //         else
        //         {
        //             dp[i][j] = dp[i + 1][(j + 1) % M] + 1;
        //         }
        //     }
        //     // cout << "dp[" << i << "][" << j << "] = " << dp[i][j] << "\n";
        // }
        // cout << "\n\n\n\n";
    }
    // vector<int> start_pos;
    // for(int i = N - M; i >= 0; i--)
    // {
    //     for(int j = 0; j < M; j++)
    //     {
    //         if(dp[i][j] >= M)
    //         {
    //             start_pos.push_back(i);
    //             // cout << i << "\n";
    //             break;
    //         }
    //     }
    // }
    int ans = 0;
    int min_x = N;
    for(int i = 0; i < start_pos.size(); i++)
    {
        // cout << "start_pos[i] = " << start_pos[i] << ", M = " << M << ", minx = " << min_x << "\n";
        if(start_pos[i] + M - 1 < min_x - 1)
        {
            return -1;
        }
        if(i == start_pos.size() - 1 || start_pos[i + 1] + M - 1 < min_x - 1 || start_pos[i] == 0)
        {
            min_x = start_pos[i];
            ans++;
        }
    }
    if(min_x != 0) return -1;
    return ans;
}

Compilation message

paint.cpp: In function 'int minimumInstructions(int, int, int, std::vector<int>, std::vector<int>, std::vector<std::vector<int> >)':
paint.cpp:21:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |             for(int j = 0; j < likings[colors[i + 2]].size(); j++)
      |                            ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
paint.cpp:28:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   28 |         for(int j = 0; j < likings[colors[i]].size(); j++)
      |                        ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
paint.cpp:77:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   77 |     for(int i = 0; i < start_pos.size(); i++)
      |                    ~~^~~~~~~~~~~~~~~~~~
paint.cpp:84:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   84 |         if(i == start_pos.size() - 1 || start_pos[i + 1] + M - 1 < min_x - 1 || start_pos[i] == 0)
      |            ~~^~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 2 ms 2644 KB Output is correct
14 Correct 2 ms 2644 KB Output is correct
15 Correct 2 ms 2644 KB Output is correct
16 Correct 2 ms 2644 KB Output is correct
17 Correct 2 ms 2644 KB Output is correct
18 Correct 3 ms 2644 KB Output is correct
19 Correct 2 ms 2616 KB Output is correct
20 Correct 2 ms 2608 KB Output is correct
21 Correct 2 ms 2644 KB Output is correct
22 Correct 20 ms 7140 KB Output is correct
23 Correct 19 ms 7136 KB Output is correct
24 Correct 21 ms 7056 KB Output is correct
25 Correct 2 ms 668 KB Output is correct
26 Correct 3 ms 596 KB Output is correct
27 Correct 3 ms 568 KB Output is correct
28 Correct 3 ms 444 KB Output is correct
29 Correct 3 ms 468 KB Output is correct
30 Correct 3 ms 468 KB Output is correct
31 Correct 10 ms 4208 KB Output is correct
32 Correct 9 ms 4180 KB Output is correct
33 Correct 9 ms 4180 KB Output is correct
34 Correct 9 ms 4080 KB Output is correct
35 Correct 9 ms 4108 KB Output is correct
36 Correct 10 ms 4180 KB Output is correct
37 Correct 26 ms 7492 KB Output is correct
38 Correct 27 ms 7500 KB Output is correct
39 Correct 24 ms 7508 KB Output is correct
40 Correct 10 ms 1740 KB Output is correct
41 Correct 7 ms 1236 KB Output is correct
42 Correct 16 ms 1752 KB Output is correct
43 Correct 9 ms 980 KB Output is correct
44 Correct 7 ms 852 KB Output is correct
45 Correct 11 ms 1308 KB Output is correct
46 Correct 44 ms 13596 KB Output is correct
47 Correct 25 ms 8480 KB Output is correct
48 Correct 30 ms 10904 KB Output is correct
49 Correct 37 ms 11144 KB Output is correct
50 Correct 45 ms 10764 KB Output is correct
51 Correct 43 ms 8060 KB Output is correct
52 Correct 11 ms 1884 KB Output is correct
53 Correct 11 ms 1892 KB Output is correct
54 Correct 11 ms 1632 KB Output is correct
55 Correct 10 ms 1376 KB Output is correct
56 Correct 11 ms 1304 KB Output is correct
57 Correct 13 ms 1212 KB Output is correct
58 Correct 48 ms 14484 KB Output is correct
59 Correct 54 ms 14420 KB Output is correct
60 Correct 50 ms 14484 KB Output is correct
61 Correct 47 ms 14404 KB Output is correct
62 Correct 52 ms 14492 KB Output is correct
63 Correct 55 ms 14544 KB Output is correct
64 Correct 55 ms 13228 KB Output is correct
65 Correct 64 ms 13184 KB Output is correct
66 Correct 50 ms 13188 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 2 ms 2644 KB Output is correct
14 Correct 2 ms 2644 KB Output is correct
15 Correct 2 ms 2644 KB Output is correct
16 Correct 2 ms 2644 KB Output is correct
17 Correct 2 ms 2644 KB Output is correct
18 Correct 3 ms 2644 KB Output is correct
19 Correct 2 ms 2616 KB Output is correct
20 Correct 2 ms 2608 KB Output is correct
21 Correct 2 ms 2644 KB Output is correct
22 Correct 0 ms 308 KB Output is correct
23 Correct 1 ms 220 KB Output is correct
24 Correct 1 ms 224 KB Output is correct
25 Correct 1 ms 224 KB Output is correct
26 Correct 1 ms 212 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
28 Correct 1 ms 304 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 1 ms 296 KB Output is correct
31 Correct 1 ms 300 KB Output is correct
32 Correct 1 ms 304 KB Output is correct
33 Correct 2 ms 2220 KB Output is correct
34 Correct 1 ms 1748 KB Output is correct
35 Correct 1 ms 1620 KB Output is correct
36 Correct 2 ms 2516 KB Output is correct
37 Correct 2 ms 2132 KB Output is correct
38 Correct 2 ms 2352 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 2 ms 2096 KB Output is correct
41 Correct 1 ms 212 KB Output is correct
42 Correct 2 ms 2516 KB Output is correct
43 Correct 2 ms 2388 KB Output is correct
44 Correct 1 ms 212 KB Output is correct
45 Correct 1 ms 212 KB Output is correct
46 Correct 1 ms 212 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 1 ms 212 KB Output is correct
49 Correct 1 ms 300 KB Output is correct
50 Correct 2 ms 2608 KB Output is correct
51 Correct 2 ms 2644 KB Output is correct
52 Correct 2 ms 2608 KB Output is correct
53 Correct 2 ms 2644 KB Output is correct
54 Correct 2 ms 2644 KB Output is correct
55 Correct 2 ms 2644 KB Output is correct
56 Correct 2 ms 2644 KB Output is correct
57 Correct 1 ms 340 KB Output is correct
58 Correct 2 ms 2644 KB Output is correct
59 Correct 1 ms 340 KB Output is correct
60 Correct 3 ms 2644 KB Output is correct
61 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 308 KB Output is correct
2 Correct 1 ms 220 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 2 ms 2644 KB Output is correct
16 Correct 2 ms 2644 KB Output is correct
17 Correct 2 ms 2644 KB Output is correct
18 Correct 2 ms 2644 KB Output is correct
19 Correct 2 ms 2644 KB Output is correct
20 Correct 3 ms 2644 KB Output is correct
21 Correct 2 ms 2616 KB Output is correct
22 Correct 2 ms 2608 KB Output is correct
23 Correct 2 ms 2644 KB Output is correct
24 Correct 20 ms 7140 KB Output is correct
25 Correct 19 ms 7136 KB Output is correct
26 Correct 21 ms 7056 KB Output is correct
27 Correct 1 ms 224 KB Output is correct
28 Correct 1 ms 224 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 1 ms 304 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 1 ms 296 KB Output is correct
34 Correct 1 ms 300 KB Output is correct
35 Correct 1 ms 304 KB Output is correct
36 Correct 2 ms 2220 KB Output is correct
37 Correct 1 ms 1748 KB Output is correct
38 Correct 1 ms 1620 KB Output is correct
39 Correct 2 ms 2516 KB Output is correct
40 Correct 2 ms 2132 KB Output is correct
41 Correct 2 ms 2352 KB Output is correct
42 Correct 1 ms 212 KB Output is correct
43 Correct 2 ms 2096 KB Output is correct
44 Correct 1 ms 212 KB Output is correct
45 Correct 2 ms 2516 KB Output is correct
46 Correct 2 ms 2388 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 1 ms 212 KB Output is correct
49 Correct 1 ms 212 KB Output is correct
50 Correct 1 ms 212 KB Output is correct
51 Correct 1 ms 212 KB Output is correct
52 Correct 1 ms 300 KB Output is correct
53 Correct 2 ms 2608 KB Output is correct
54 Correct 2 ms 2644 KB Output is correct
55 Correct 2 ms 2608 KB Output is correct
56 Correct 2 ms 2644 KB Output is correct
57 Correct 2 ms 2644 KB Output is correct
58 Correct 2 ms 2644 KB Output is correct
59 Correct 2 ms 2644 KB Output is correct
60 Correct 1 ms 340 KB Output is correct
61 Correct 2 ms 2644 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 3 ms 2644 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 2 ms 324 KB Output is correct
66 Correct 1 ms 212 KB Output is correct
67 Correct 2 ms 212 KB Output is correct
68 Correct 1 ms 212 KB Output is correct
69 Correct 2 ms 212 KB Output is correct
70 Correct 3 ms 2492 KB Output is correct
71 Correct 3 ms 2132 KB Output is correct
72 Correct 3 ms 1876 KB Output is correct
73 Correct 3 ms 2004 KB Output is correct
74 Correct 3 ms 2388 KB Output is correct
75 Correct 3 ms 2772 KB Output is correct
76 Correct 19 ms 5204 KB Output is correct
77 Correct 21 ms 6216 KB Output is correct
78 Correct 26 ms 6860 KB Output is correct
79 Correct 3 ms 300 KB Output is correct
80 Correct 3 ms 212 KB Output is correct
81 Correct 3 ms 212 KB Output is correct
82 Correct 3 ms 212 KB Output is correct
83 Correct 3 ms 340 KB Output is correct
84 Correct 5 ms 2900 KB Output is correct
85 Correct 4 ms 2900 KB Output is correct
86 Correct 4 ms 2900 KB Output is correct
87 Correct 4 ms 2900 KB Output is correct
88 Correct 4 ms 2948 KB Output is correct
89 Correct 4 ms 2900 KB Output is correct
90 Correct 35 ms 7260 KB Output is correct
91 Correct 32 ms 7212 KB Output is correct
92 Correct 37 ms 7240 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 308 KB Output is correct
2 Correct 1 ms 220 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 2 ms 2644 KB Output is correct
16 Correct 2 ms 2644 KB Output is correct
17 Correct 2 ms 2644 KB Output is correct
18 Correct 2 ms 2644 KB Output is correct
19 Correct 2 ms 2644 KB Output is correct
20 Correct 3 ms 2644 KB Output is correct
21 Correct 2 ms 2616 KB Output is correct
22 Correct 2 ms 2608 KB Output is correct
23 Correct 2 ms 2644 KB Output is correct
24 Correct 20 ms 7140 KB Output is correct
25 Correct 19 ms 7136 KB Output is correct
26 Correct 21 ms 7056 KB Output is correct
27 Correct 2 ms 668 KB Output is correct
28 Correct 3 ms 596 KB Output is correct
29 Correct 3 ms 568 KB Output is correct
30 Correct 3 ms 444 KB Output is correct
31 Correct 3 ms 468 KB Output is correct
32 Correct 3 ms 468 KB Output is correct
33 Correct 10 ms 4208 KB Output is correct
34 Correct 9 ms 4180 KB Output is correct
35 Correct 9 ms 4180 KB Output is correct
36 Correct 9 ms 4080 KB Output is correct
37 Correct 9 ms 4108 KB Output is correct
38 Correct 10 ms 4180 KB Output is correct
39 Correct 26 ms 7492 KB Output is correct
40 Correct 27 ms 7500 KB Output is correct
41 Correct 24 ms 7508 KB Output is correct
42 Correct 1 ms 224 KB Output is correct
43 Correct 1 ms 224 KB Output is correct
44 Correct 1 ms 212 KB Output is correct
45 Correct 1 ms 212 KB Output is correct
46 Correct 1 ms 304 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 1 ms 296 KB Output is correct
49 Correct 1 ms 300 KB Output is correct
50 Correct 1 ms 304 KB Output is correct
51 Correct 2 ms 2220 KB Output is correct
52 Correct 1 ms 1748 KB Output is correct
53 Correct 1 ms 1620 KB Output is correct
54 Correct 2 ms 2516 KB Output is correct
55 Correct 2 ms 2132 KB Output is correct
56 Correct 2 ms 2352 KB Output is correct
57 Correct 1 ms 212 KB Output is correct
58 Correct 2 ms 2096 KB Output is correct
59 Correct 1 ms 212 KB Output is correct
60 Correct 2 ms 2516 KB Output is correct
61 Correct 2 ms 2388 KB Output is correct
62 Correct 1 ms 212 KB Output is correct
63 Correct 1 ms 212 KB Output is correct
64 Correct 1 ms 212 KB Output is correct
65 Correct 1 ms 212 KB Output is correct
66 Correct 1 ms 212 KB Output is correct
67 Correct 1 ms 300 KB Output is correct
68 Correct 2 ms 2608 KB Output is correct
69 Correct 2 ms 2644 KB Output is correct
70 Correct 2 ms 2608 KB Output is correct
71 Correct 2 ms 2644 KB Output is correct
72 Correct 2 ms 2644 KB Output is correct
73 Correct 2 ms 2644 KB Output is correct
74 Correct 2 ms 2644 KB Output is correct
75 Correct 1 ms 340 KB Output is correct
76 Correct 2 ms 2644 KB Output is correct
77 Correct 1 ms 340 KB Output is correct
78 Correct 3 ms 2644 KB Output is correct
79 Correct 1 ms 340 KB Output is correct
80 Correct 2 ms 324 KB Output is correct
81 Correct 1 ms 212 KB Output is correct
82 Correct 2 ms 212 KB Output is correct
83 Correct 1 ms 212 KB Output is correct
84 Correct 2 ms 212 KB Output is correct
85 Correct 3 ms 2492 KB Output is correct
86 Correct 3 ms 2132 KB Output is correct
87 Correct 3 ms 1876 KB Output is correct
88 Correct 3 ms 2004 KB Output is correct
89 Correct 3 ms 2388 KB Output is correct
90 Correct 3 ms 2772 KB Output is correct
91 Correct 19 ms 5204 KB Output is correct
92 Correct 21 ms 6216 KB Output is correct
93 Correct 26 ms 6860 KB Output is correct
94 Correct 3 ms 300 KB Output is correct
95 Correct 3 ms 212 KB Output is correct
96 Correct 3 ms 212 KB Output is correct
97 Correct 3 ms 212 KB Output is correct
98 Correct 3 ms 340 KB Output is correct
99 Correct 5 ms 2900 KB Output is correct
100 Correct 4 ms 2900 KB Output is correct
101 Correct 4 ms 2900 KB Output is correct
102 Correct 4 ms 2900 KB Output is correct
103 Correct 4 ms 2948 KB Output is correct
104 Correct 4 ms 2900 KB Output is correct
105 Correct 35 ms 7260 KB Output is correct
106 Correct 32 ms 7212 KB Output is correct
107 Correct 37 ms 7240 KB Output is correct
108 Correct 3 ms 596 KB Output is correct
109 Correct 174 ms 556 KB Output is correct
110 Correct 122 ms 492 KB Output is correct
111 Correct 97 ms 500 KB Output is correct
112 Correct 111 ms 476 KB Output is correct
113 Correct 67 ms 524 KB Output is correct
114 Correct 14 ms 4284 KB Output is correct
115 Correct 14 ms 3932 KB Output is correct
116 Correct 20 ms 4488 KB Output is correct
117 Correct 17 ms 3560 KB Output is correct
118 Correct 18 ms 4148 KB Output is correct
119 Correct 14 ms 3900 KB Output is correct
120 Correct 19 ms 4820 KB Output is correct
121 Correct 5 ms 1364 KB Output is correct
122 Correct 24 ms 5040 KB Output is correct
123 Correct 4 ms 1236 KB Output is correct
124 Correct 24 ms 6028 KB Output is correct
125 Correct 7 ms 1760 KB Output is correct
126 Correct 8 ms 2648 KB Output is correct
127 Correct 9 ms 3392 KB Output is correct
128 Correct 9 ms 2880 KB Output is correct
129 Correct 7 ms 2424 KB Output is correct
130 Correct 3 ms 596 KB Output is correct
131 Correct 213 ms 688 KB Output is correct
132 Correct 208 ms 596 KB Output is correct
133 Correct 186 ms 608 KB Output is correct
134 Correct 148 ms 616 KB Output is correct
135 Correct 126 ms 636 KB Output is correct
136 Correct 19 ms 4916 KB Output is correct
137 Correct 19 ms 4900 KB Output is correct
138 Correct 18 ms 4968 KB Output is correct
139 Correct 18 ms 5088 KB Output is correct
140 Correct 29 ms 4960 KB Output is correct
141 Correct 21 ms 4964 KB Output is correct
142 Correct 54 ms 7736 KB Output is correct
143 Correct 11 ms 1988 KB Output is correct
144 Correct 36 ms 7640 KB Output is correct
145 Correct 9 ms 2020 KB Output is correct
146 Correct 35 ms 7704 KB Output is correct
147 Correct 8 ms 1988 KB Output is correct
148 Correct 10 ms 4060 KB Output is correct
149 Correct 10 ms 4056 KB Output is correct
150 Correct 9 ms 3900 KB Output is correct
151 Correct 11 ms 3924 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 308 KB Output is correct
2 Correct 1 ms 220 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 2 ms 2644 KB Output is correct
16 Correct 2 ms 2644 KB Output is correct
17 Correct 2 ms 2644 KB Output is correct
18 Correct 2 ms 2644 KB Output is correct
19 Correct 2 ms 2644 KB Output is correct
20 Correct 3 ms 2644 KB Output is correct
21 Correct 2 ms 2616 KB Output is correct
22 Correct 2 ms 2608 KB Output is correct
23 Correct 2 ms 2644 KB Output is correct
24 Correct 20 ms 7140 KB Output is correct
25 Correct 19 ms 7136 KB Output is correct
26 Correct 21 ms 7056 KB Output is correct
27 Correct 2 ms 668 KB Output is correct
28 Correct 3 ms 596 KB Output is correct
29 Correct 3 ms 568 KB Output is correct
30 Correct 3 ms 444 KB Output is correct
31 Correct 3 ms 468 KB Output is correct
32 Correct 3 ms 468 KB Output is correct
33 Correct 10 ms 4208 KB Output is correct
34 Correct 9 ms 4180 KB Output is correct
35 Correct 9 ms 4180 KB Output is correct
36 Correct 9 ms 4080 KB Output is correct
37 Correct 9 ms 4108 KB Output is correct
38 Correct 10 ms 4180 KB Output is correct
39 Correct 26 ms 7492 KB Output is correct
40 Correct 27 ms 7500 KB Output is correct
41 Correct 24 ms 7508 KB Output is correct
42 Correct 10 ms 1740 KB Output is correct
43 Correct 7 ms 1236 KB Output is correct
44 Correct 16 ms 1752 KB Output is correct
45 Correct 9 ms 980 KB Output is correct
46 Correct 7 ms 852 KB Output is correct
47 Correct 11 ms 1308 KB Output is correct
48 Correct 44 ms 13596 KB Output is correct
49 Correct 25 ms 8480 KB Output is correct
50 Correct 30 ms 10904 KB Output is correct
51 Correct 37 ms 11144 KB Output is correct
52 Correct 45 ms 10764 KB Output is correct
53 Correct 43 ms 8060 KB Output is correct
54 Correct 11 ms 1884 KB Output is correct
55 Correct 11 ms 1892 KB Output is correct
56 Correct 11 ms 1632 KB Output is correct
57 Correct 10 ms 1376 KB Output is correct
58 Correct 11 ms 1304 KB Output is correct
59 Correct 13 ms 1212 KB Output is correct
60 Correct 48 ms 14484 KB Output is correct
61 Correct 54 ms 14420 KB Output is correct
62 Correct 50 ms 14484 KB Output is correct
63 Correct 47 ms 14404 KB Output is correct
64 Correct 52 ms 14492 KB Output is correct
65 Correct 55 ms 14544 KB Output is correct
66 Correct 55 ms 13228 KB Output is correct
67 Correct 64 ms 13184 KB Output is correct
68 Correct 50 ms 13188 KB Output is correct
69 Correct 1 ms 224 KB Output is correct
70 Correct 1 ms 224 KB Output is correct
71 Correct 1 ms 212 KB Output is correct
72 Correct 1 ms 212 KB Output is correct
73 Correct 1 ms 304 KB Output is correct
74 Correct 1 ms 212 KB Output is correct
75 Correct 1 ms 296 KB Output is correct
76 Correct 1 ms 300 KB Output is correct
77 Correct 1 ms 304 KB Output is correct
78 Correct 2 ms 2220 KB Output is correct
79 Correct 1 ms 1748 KB Output is correct
80 Correct 1 ms 1620 KB Output is correct
81 Correct 2 ms 2516 KB Output is correct
82 Correct 2 ms 2132 KB Output is correct
83 Correct 2 ms 2352 KB Output is correct
84 Correct 1 ms 212 KB Output is correct
85 Correct 2 ms 2096 KB Output is correct
86 Correct 1 ms 212 KB Output is correct
87 Correct 2 ms 2516 KB Output is correct
88 Correct 2 ms 2388 KB Output is correct
89 Correct 1 ms 212 KB Output is correct
90 Correct 1 ms 212 KB Output is correct
91 Correct 1 ms 212 KB Output is correct
92 Correct 1 ms 212 KB Output is correct
93 Correct 1 ms 212 KB Output is correct
94 Correct 1 ms 300 KB Output is correct
95 Correct 2 ms 2608 KB Output is correct
96 Correct 2 ms 2644 KB Output is correct
97 Correct 2 ms 2608 KB Output is correct
98 Correct 2 ms 2644 KB Output is correct
99 Correct 2 ms 2644 KB Output is correct
100 Correct 2 ms 2644 KB Output is correct
101 Correct 2 ms 2644 KB Output is correct
102 Correct 1 ms 340 KB Output is correct
103 Correct 2 ms 2644 KB Output is correct
104 Correct 1 ms 340 KB Output is correct
105 Correct 3 ms 2644 KB Output is correct
106 Correct 1 ms 340 KB Output is correct
107 Correct 2 ms 324 KB Output is correct
108 Correct 1 ms 212 KB Output is correct
109 Correct 2 ms 212 KB Output is correct
110 Correct 1 ms 212 KB Output is correct
111 Correct 2 ms 212 KB Output is correct
112 Correct 3 ms 2492 KB Output is correct
113 Correct 3 ms 2132 KB Output is correct
114 Correct 3 ms 1876 KB Output is correct
115 Correct 3 ms 2004 KB Output is correct
116 Correct 3 ms 2388 KB Output is correct
117 Correct 3 ms 2772 KB Output is correct
118 Correct 19 ms 5204 KB Output is correct
119 Correct 21 ms 6216 KB Output is correct
120 Correct 26 ms 6860 KB Output is correct
121 Correct 3 ms 300 KB Output is correct
122 Correct 3 ms 212 KB Output is correct
123 Correct 3 ms 212 KB Output is correct
124 Correct 3 ms 212 KB Output is correct
125 Correct 3 ms 340 KB Output is correct
126 Correct 5 ms 2900 KB Output is correct
127 Correct 4 ms 2900 KB Output is correct
128 Correct 4 ms 2900 KB Output is correct
129 Correct 4 ms 2900 KB Output is correct
130 Correct 4 ms 2948 KB Output is correct
131 Correct 4 ms 2900 KB Output is correct
132 Correct 35 ms 7260 KB Output is correct
133 Correct 32 ms 7212 KB Output is correct
134 Correct 37 ms 7240 KB Output is correct
135 Correct 3 ms 596 KB Output is correct
136 Correct 174 ms 556 KB Output is correct
137 Correct 122 ms 492 KB Output is correct
138 Correct 97 ms 500 KB Output is correct
139 Correct 111 ms 476 KB Output is correct
140 Correct 67 ms 524 KB Output is correct
141 Correct 14 ms 4284 KB Output is correct
142 Correct 14 ms 3932 KB Output is correct
143 Correct 20 ms 4488 KB Output is correct
144 Correct 17 ms 3560 KB Output is correct
145 Correct 18 ms 4148 KB Output is correct
146 Correct 14 ms 3900 KB Output is correct
147 Correct 19 ms 4820 KB Output is correct
148 Correct 5 ms 1364 KB Output is correct
149 Correct 24 ms 5040 KB Output is correct
150 Correct 4 ms 1236 KB Output is correct
151 Correct 24 ms 6028 KB Output is correct
152 Correct 7 ms 1760 KB Output is correct
153 Correct 8 ms 2648 KB Output is correct
154 Correct 9 ms 3392 KB Output is correct
155 Correct 9 ms 2880 KB Output is correct
156 Correct 7 ms 2424 KB Output is correct
157 Correct 3 ms 596 KB Output is correct
158 Correct 213 ms 688 KB Output is correct
159 Correct 208 ms 596 KB Output is correct
160 Correct 186 ms 608 KB Output is correct
161 Correct 148 ms 616 KB Output is correct
162 Correct 126 ms 636 KB Output is correct
163 Correct 19 ms 4916 KB Output is correct
164 Correct 19 ms 4900 KB Output is correct
165 Correct 18 ms 4968 KB Output is correct
166 Correct 18 ms 5088 KB Output is correct
167 Correct 29 ms 4960 KB Output is correct
168 Correct 21 ms 4964 KB Output is correct
169 Correct 54 ms 7736 KB Output is correct
170 Correct 11 ms 1988 KB Output is correct
171 Correct 36 ms 7640 KB Output is correct
172 Correct 9 ms 2020 KB Output is correct
173 Correct 35 ms 7704 KB Output is correct
174 Correct 8 ms 1988 KB Output is correct
175 Correct 10 ms 4060 KB Output is correct
176 Correct 10 ms 4056 KB Output is correct
177 Correct 9 ms 3900 KB Output is correct
178 Correct 11 ms 3924 KB Output is correct
179 Correct 9 ms 1236 KB Output is correct
180 Correct 489 ms 1284 KB Output is correct
181 Correct 694 ms 1144 KB Output is correct
182 Correct 844 ms 1404 KB Output is correct
183 Correct 427 ms 1080 KB Output is correct
184 Correct 319 ms 1072 KB Output is correct
185 Correct 31 ms 6240 KB Output is correct
186 Correct 31 ms 8116 KB Output is correct
187 Correct 53 ms 7448 KB Output is correct
188 Correct 33 ms 6472 KB Output is correct
189 Correct 35 ms 7256 KB Output is correct
190 Correct 41 ms 7348 KB Output is correct
191 Correct 35 ms 7716 KB Output is correct
192 Correct 34 ms 5712 KB Output is correct
193 Correct 32 ms 5304 KB Output is correct
194 Correct 12 ms 1872 KB Output is correct
195 Correct 1249 ms 2092 KB Output is correct
196 Correct 1014 ms 1404 KB Output is correct
197 Correct 876 ms 1428 KB Output is correct
198 Correct 659 ms 1484 KB Output is correct
199 Correct 635 ms 1568 KB Output is correct
200 Correct 66 ms 15040 KB Output is correct
201 Correct 83 ms 14996 KB Output is correct
202 Correct 82 ms 15048 KB Output is correct
203 Correct 66 ms 15100 KB Output is correct
204 Correct 67 ms 15068 KB Output is correct
205 Correct 66 ms 15008 KB Output is correct
206 Correct 58 ms 13436 KB Output is correct
207 Correct 53 ms 13380 KB Output is correct
208 Correct 60 ms 13484 KB Output is correct
209 Correct 62 ms 13320 KB Output is correct
210 Correct 89 ms 13488 KB Output is correct
211 Correct 56 ms 13284 KB Output is correct
212 Correct 62 ms 14312 KB Output is correct
213 Correct 55 ms 11172 KB Output is correct
214 Correct 61 ms 10548 KB Output is correct
215 Correct 60 ms 10396 KB Output is correct