답안 #697501

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
697501 2023-02-10T06:58:02 Z sharaelong 벽 칠하기 (APIO20_paint) C++17
63 / 100
1500 ms 266796 KB
#include "paint.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const int MAX_N = 1e5 + 1;

int minimumInstructions(int n, int m, int k, vector<int> C, vector<int> A, vector<vector<int>> B) {
    vector<vector<int>> likes(k);
    for (int i=0; i<m; ++i) {
        for (int j=0; j<A[i]; ++j) {
            likes[B[i][j]].push_back(i);
        }
    }
    // for (int i=0; i<k; ++i) {
    //     for (int x: likes[i]) cout << x << ' ';
    //     cout << endl;
    // }
    
    vector<vector<int>> nxt(n);
    vector<vector<bool>> processed(n);
    for (int i=0; i<n; ++i) {
        nxt[i].resize(likes[C[i]].size(), -1);
        processed[i].resize(likes[C[i]].size(), false);
    }

    vector<int> pnt(n, 0);
    for (int i=0; i+1<n; ++i) {
        const vector<int>& cands = likes[C[i+1]];
        for (int j=0; j<likes[C[i]].size(); ++j) {
            int x = likes[C[i]][j];
            if (x+1 < m) {
                while (pnt[i+1] < cands.size() && cands[pnt[i+1]] <= x) pnt[i+1]++;
                if (pnt[i+1] < cands.size() && cands[pnt[i+1]] == x+1) nxt[i][j] = pnt[i+1];
            } else {
                if (!cands.empty() && cands[0] == 0) nxt[i][j] = 0;
            }
        }
    }
    // for (int i=0; i<n; ++i) {
    //     for (int x: nxt[i]) cout << x << ' ';
    //     cout << endl;
    // }

    vector<int> okay(n+1, 0);
    for (int i=0; i<n; ++i) {
        for (int j=0; j<likes[C[i]].size(); ++j) {
            if (!processed[i][j]) {
                processed[i][j] = true;
                int ii = i, jj = j;
                while (ii < n && nxt[ii][jj] != -1) {
                    jj = nxt[ii][jj];
                    ii++;
                    processed[ii][jj] = true;
                }

                if (ii == n) ii--;
                if (ii-i+1 >= m) {
                    okay[i]++;
                    okay[ii-m+2]--;
                }
            }
        }
    }
    for (int i=1; i<okay.size(); ++i) okay[i] += okay[i-1];
    // for (int i=0; i<n; ++i) cout << okay[i] << ' ';
    // cout << endl;

    vector<int> valid_pos;
    for (int i=0; i<n; ++i) {
        if (okay[i] > 0) valid_pos.push_back(i);
    }
    if (valid_pos.empty() || valid_pos[0] > 0) return -1;

    int ans = 1;
    int curr = 0;
    while (curr + m < n) {
        auto it = upper_bound(valid_pos.begin(), valid_pos.end(), curr+m);
        if (*prev(it) == curr) return -1;
        curr = *prev(it);
        ans++;
    }
    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:30:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |         for (int j=0; j<likes[C[i]].size(); ++j) {
      |                       ~^~~~~~~~~~~~~~~~~~~
paint.cpp:33:33: warning: comparison of integer expressions of different signedness: '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |                 while (pnt[i+1] < cands.size() && cands[pnt[i+1]] <= x) pnt[i+1]++;
paint.cpp:34:30: warning: comparison of integer expressions of different signedness: '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   34 |                 if (pnt[i+1] < cands.size() && cands[pnt[i+1]] == x+1) nxt[i][j] = pnt[i+1];
paint.cpp:47:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   47 |         for (int j=0; j<likes[C[i]].size(); ++j) {
      |                       ~^~~~~~~~~~~~~~~~~~~
paint.cpp:65:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   65 |     for (int i=1; i<okay.size(); ++i) okay[i] += okay[i-1];
      |                   ~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 1 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 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 2 ms 2772 KB Output is correct
14 Correct 2 ms 2644 KB Output is correct
15 Correct 2 ms 2772 KB Output is correct
16 Correct 2 ms 2772 KB Output is correct
17 Correct 2 ms 2644 KB Output is correct
18 Correct 2 ms 2772 KB Output is correct
19 Correct 2 ms 2644 KB Output is correct
20 Correct 2 ms 2644 KB Output is correct
21 Correct 2 ms 2644 KB Output is correct
22 Correct 22 ms 7116 KB Output is correct
23 Correct 20 ms 7132 KB Output is correct
24 Correct 20 ms 7132 KB Output is correct
25 Correct 6 ms 3252 KB Output is correct
26 Correct 6 ms 3284 KB Output is correct
27 Correct 5 ms 3256 KB Output is correct
28 Correct 5 ms 3156 KB Output is correct
29 Correct 8 ms 3128 KB Output is correct
30 Correct 5 ms 3136 KB Output is correct
31 Correct 11 ms 6760 KB Output is correct
32 Correct 11 ms 6760 KB Output is correct
33 Correct 12 ms 6740 KB Output is correct
34 Correct 12 ms 6740 KB Output is correct
35 Correct 12 ms 6772 KB Output is correct
36 Correct 11 ms 6740 KB Output is correct
37 Correct 27 ms 10160 KB Output is correct
38 Correct 28 ms 10188 KB Output is correct
39 Correct 29 ms 10188 KB Output is correct
40 Correct 28 ms 13876 KB Output is correct
41 Correct 18 ms 8744 KB Output is correct
42 Correct 26 ms 14672 KB Output is correct
43 Correct 16 ms 9684 KB Output is correct
44 Correct 16 ms 8708 KB Output is correct
45 Correct 26 ms 14448 KB Output is correct
46 Correct 56 ms 24560 KB Output is correct
47 Correct 35 ms 15664 KB Output is correct
48 Correct 39 ms 17912 KB Output is correct
49 Correct 49 ms 18888 KB Output is correct
50 Correct 65 ms 19932 KB Output is correct
51 Correct 43 ms 17724 KB Output is correct
52 Correct 29 ms 15132 KB Output is correct
53 Correct 29 ms 15140 KB Output is correct
54 Correct 25 ms 14900 KB Output is correct
55 Correct 25 ms 14580 KB Output is correct
56 Correct 25 ms 14588 KB Output is correct
57 Correct 24 ms 14516 KB Output is correct
58 Correct 68 ms 27292 KB Output is correct
59 Correct 73 ms 27400 KB Output is correct
60 Correct 69 ms 27304 KB Output is correct
61 Correct 64 ms 27280 KB Output is correct
62 Correct 64 ms 27288 KB Output is correct
63 Correct 65 ms 27288 KB Output is correct
64 Correct 65 ms 26148 KB Output is correct
65 Correct 87 ms 26248 KB Output is correct
66 Correct 75 ms 26164 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 1 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 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 2 ms 2772 KB Output is correct
14 Correct 2 ms 2644 KB Output is correct
15 Correct 2 ms 2772 KB Output is correct
16 Correct 2 ms 2772 KB Output is correct
17 Correct 2 ms 2644 KB Output is correct
18 Correct 2 ms 2772 KB Output is correct
19 Correct 2 ms 2644 KB Output is correct
20 Correct 2 ms 2644 KB Output is correct
21 Correct 2 ms 2644 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 1 ms 304 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 1 ms 304 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 2 ms 2352 KB Output is correct
34 Correct 1 ms 1876 KB Output is correct
35 Correct 1 ms 1620 KB Output is correct
36 Correct 2 ms 2644 KB Output is correct
37 Correct 2 ms 2132 KB Output is correct
38 Correct 2 ms 2388 KB Output is correct
39 Correct 1 ms 340 KB Output is correct
40 Correct 2 ms 2132 KB Output is correct
41 Correct 1 ms 296 KB Output is correct
42 Correct 2 ms 2516 KB Output is correct
43 Correct 2 ms 2476 KB Output is correct
44 Correct 1 ms 300 KB Output is correct
45 Correct 1 ms 428 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 340 KB Output is correct
48 Correct 1 ms 300 KB Output is correct
49 Correct 1 ms 340 KB Output is correct
50 Correct 2 ms 2732 KB Output is correct
51 Correct 2 ms 2772 KB Output is correct
52 Correct 2 ms 2644 KB Output is correct
53 Correct 2 ms 2732 KB Output is correct
54 Correct 2 ms 2772 KB Output is correct
55 Correct 2 ms 2736 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 2 ms 2644 KB Output is correct
61 Correct 1 ms 304 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 304 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 300 KB Output is correct
5 Correct 1 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 1 ms 340 KB Output is correct
10 Correct 1 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 1 ms 340 KB Output is correct
15 Correct 2 ms 2772 KB Output is correct
16 Correct 2 ms 2644 KB Output is correct
17 Correct 2 ms 2772 KB Output is correct
18 Correct 2 ms 2772 KB Output is correct
19 Correct 2 ms 2644 KB Output is correct
20 Correct 2 ms 2772 KB Output is correct
21 Correct 2 ms 2644 KB Output is correct
22 Correct 2 ms 2644 KB Output is correct
23 Correct 2 ms 2644 KB Output is correct
24 Correct 22 ms 7116 KB Output is correct
25 Correct 20 ms 7132 KB Output is correct
26 Correct 20 ms 7132 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 0 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 304 KB Output is correct
33 Correct 1 ms 340 KB Output is correct
34 Correct 1 ms 340 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 2 ms 2352 KB Output is correct
37 Correct 1 ms 1876 KB Output is correct
38 Correct 1 ms 1620 KB Output is correct
39 Correct 2 ms 2644 KB Output is correct
40 Correct 2 ms 2132 KB Output is correct
41 Correct 2 ms 2388 KB Output is correct
42 Correct 1 ms 340 KB Output is correct
43 Correct 2 ms 2132 KB Output is correct
44 Correct 1 ms 296 KB Output is correct
45 Correct 2 ms 2516 KB Output is correct
46 Correct 2 ms 2476 KB Output is correct
47 Correct 1 ms 300 KB Output is correct
48 Correct 1 ms 428 KB Output is correct
49 Correct 1 ms 340 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 300 KB Output is correct
52 Correct 1 ms 340 KB Output is correct
53 Correct 2 ms 2732 KB Output is correct
54 Correct 2 ms 2772 KB Output is correct
55 Correct 2 ms 2644 KB Output is correct
56 Correct 2 ms 2732 KB Output is correct
57 Correct 2 ms 2772 KB Output is correct
58 Correct 2 ms 2736 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 2 ms 2644 KB Output is correct
64 Correct 1 ms 304 KB Output is correct
65 Correct 1 ms 432 KB Output is correct
66 Correct 1 ms 340 KB Output is correct
67 Correct 1 ms 596 KB Output is correct
68 Correct 1 ms 468 KB Output is correct
69 Correct 2 ms 560 KB Output is correct
70 Correct 3 ms 2548 KB Output is correct
71 Correct 3 ms 2260 KB Output is correct
72 Correct 3 ms 2004 KB Output is correct
73 Correct 2 ms 2132 KB Output is correct
74 Correct 3 ms 2420 KB Output is correct
75 Correct 3 ms 2792 KB Output is correct
76 Correct 22 ms 5196 KB Output is correct
77 Correct 20 ms 6064 KB Output is correct
78 Correct 26 ms 6888 KB Output is correct
79 Correct 2 ms 724 KB Output is correct
80 Correct 2 ms 680 KB Output is correct
81 Correct 2 ms 684 KB Output is correct
82 Correct 2 ms 684 KB Output is correct
83 Correct 2 ms 724 KB Output is correct
84 Correct 4 ms 3028 KB Output is correct
85 Correct 4 ms 3028 KB Output is correct
86 Correct 4 ms 3028 KB Output is correct
87 Correct 4 ms 3028 KB Output is correct
88 Correct 4 ms 3028 KB Output is correct
89 Correct 4 ms 3028 KB Output is correct
90 Correct 30 ms 7328 KB Output is correct
91 Correct 33 ms 7324 KB Output is correct
92 Correct 37 ms 7352 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 304 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 300 KB Output is correct
5 Correct 1 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 1 ms 340 KB Output is correct
10 Correct 1 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 1 ms 340 KB Output is correct
15 Correct 2 ms 2772 KB Output is correct
16 Correct 2 ms 2644 KB Output is correct
17 Correct 2 ms 2772 KB Output is correct
18 Correct 2 ms 2772 KB Output is correct
19 Correct 2 ms 2644 KB Output is correct
20 Correct 2 ms 2772 KB Output is correct
21 Correct 2 ms 2644 KB Output is correct
22 Correct 2 ms 2644 KB Output is correct
23 Correct 2 ms 2644 KB Output is correct
24 Correct 22 ms 7116 KB Output is correct
25 Correct 20 ms 7132 KB Output is correct
26 Correct 20 ms 7132 KB Output is correct
27 Correct 6 ms 3252 KB Output is correct
28 Correct 6 ms 3284 KB Output is correct
29 Correct 5 ms 3256 KB Output is correct
30 Correct 5 ms 3156 KB Output is correct
31 Correct 8 ms 3128 KB Output is correct
32 Correct 5 ms 3136 KB Output is correct
33 Correct 11 ms 6760 KB Output is correct
34 Correct 11 ms 6760 KB Output is correct
35 Correct 12 ms 6740 KB Output is correct
36 Correct 12 ms 6740 KB Output is correct
37 Correct 12 ms 6772 KB Output is correct
38 Correct 11 ms 6740 KB Output is correct
39 Correct 27 ms 10160 KB Output is correct
40 Correct 28 ms 10188 KB Output is correct
41 Correct 29 ms 10188 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 0 ms 212 KB Output is correct
44 Correct 0 ms 212 KB Output is correct
45 Correct 1 ms 340 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 304 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 340 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 2 ms 2352 KB Output is correct
52 Correct 1 ms 1876 KB Output is correct
53 Correct 1 ms 1620 KB Output is correct
54 Correct 2 ms 2644 KB Output is correct
55 Correct 2 ms 2132 KB Output is correct
56 Correct 2 ms 2388 KB Output is correct
57 Correct 1 ms 340 KB Output is correct
58 Correct 2 ms 2132 KB Output is correct
59 Correct 1 ms 296 KB Output is correct
60 Correct 2 ms 2516 KB Output is correct
61 Correct 2 ms 2476 KB Output is correct
62 Correct 1 ms 300 KB Output is correct
63 Correct 1 ms 428 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 1 ms 300 KB Output is correct
67 Correct 1 ms 340 KB Output is correct
68 Correct 2 ms 2732 KB Output is correct
69 Correct 2 ms 2772 KB Output is correct
70 Correct 2 ms 2644 KB Output is correct
71 Correct 2 ms 2732 KB Output is correct
72 Correct 2 ms 2772 KB Output is correct
73 Correct 2 ms 2736 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 2 ms 2644 KB Output is correct
79 Correct 1 ms 304 KB Output is correct
80 Correct 1 ms 432 KB Output is correct
81 Correct 1 ms 340 KB Output is correct
82 Correct 1 ms 596 KB Output is correct
83 Correct 1 ms 468 KB Output is correct
84 Correct 2 ms 560 KB Output is correct
85 Correct 3 ms 2548 KB Output is correct
86 Correct 3 ms 2260 KB Output is correct
87 Correct 3 ms 2004 KB Output is correct
88 Correct 2 ms 2132 KB Output is correct
89 Correct 3 ms 2420 KB Output is correct
90 Correct 3 ms 2792 KB Output is correct
91 Correct 22 ms 5196 KB Output is correct
92 Correct 20 ms 6064 KB Output is correct
93 Correct 26 ms 6888 KB Output is correct
94 Correct 2 ms 724 KB Output is correct
95 Correct 2 ms 680 KB Output is correct
96 Correct 2 ms 684 KB Output is correct
97 Correct 2 ms 684 KB Output is correct
98 Correct 2 ms 724 KB Output is correct
99 Correct 4 ms 3028 KB Output is correct
100 Correct 4 ms 3028 KB Output is correct
101 Correct 4 ms 3028 KB Output is correct
102 Correct 4 ms 3028 KB Output is correct
103 Correct 4 ms 3028 KB Output is correct
104 Correct 4 ms 3028 KB Output is correct
105 Correct 30 ms 7328 KB Output is correct
106 Correct 33 ms 7324 KB Output is correct
107 Correct 37 ms 7352 KB Output is correct
108 Correct 6 ms 3284 KB Output is correct
109 Correct 155 ms 38156 KB Output is correct
110 Correct 97 ms 21244 KB Output is correct
111 Correct 79 ms 15956 KB Output is correct
112 Correct 92 ms 18812 KB Output is correct
113 Correct 59 ms 12600 KB Output is correct
114 Correct 14 ms 5668 KB Output is correct
115 Correct 14 ms 5184 KB Output is correct
116 Correct 19 ms 6968 KB Output is correct
117 Correct 15 ms 4948 KB Output is correct
118 Correct 16 ms 5836 KB Output is correct
119 Correct 13 ms 5848 KB Output is correct
120 Correct 20 ms 6220 KB Output is correct
121 Correct 8 ms 2892 KB Output is correct
122 Correct 25 ms 6432 KB Output is correct
123 Correct 6 ms 2748 KB Output is correct
124 Correct 28 ms 8328 KB Output is correct
125 Correct 9 ms 4308 KB Output is correct
126 Correct 9 ms 4672 KB Output is correct
127 Correct 12 ms 5844 KB Output is correct
128 Correct 8 ms 4776 KB Output is correct
129 Correct 8 ms 4308 KB Output is correct
130 Correct 6 ms 3252 KB Output is correct
131 Correct 236 ms 53772 KB Output is correct
132 Correct 180 ms 38560 KB Output is correct
133 Correct 155 ms 32080 KB Output is correct
134 Correct 134 ms 27948 KB Output is correct
135 Correct 117 ms 25328 KB Output is correct
136 Correct 20 ms 7636 KB Output is correct
137 Correct 21 ms 7628 KB Output is correct
138 Correct 22 ms 7592 KB Output is correct
139 Correct 21 ms 7628 KB Output is correct
140 Correct 21 ms 7656 KB Output is correct
141 Correct 21 ms 7648 KB Output is correct
142 Correct 36 ms 10076 KB Output is correct
143 Correct 11 ms 4692 KB Output is correct
144 Correct 36 ms 10040 KB Output is correct
145 Correct 11 ms 4608 KB Output is correct
146 Correct 36 ms 10024 KB Output is correct
147 Correct 11 ms 4692 KB Output is correct
148 Correct 14 ms 6716 KB Output is correct
149 Correct 13 ms 6636 KB Output is correct
150 Correct 12 ms 6612 KB Output is correct
151 Correct 15 ms 6552 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 304 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 300 KB Output is correct
5 Correct 1 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 1 ms 340 KB Output is correct
10 Correct 1 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 1 ms 340 KB Output is correct
15 Correct 2 ms 2772 KB Output is correct
16 Correct 2 ms 2644 KB Output is correct
17 Correct 2 ms 2772 KB Output is correct
18 Correct 2 ms 2772 KB Output is correct
19 Correct 2 ms 2644 KB Output is correct
20 Correct 2 ms 2772 KB Output is correct
21 Correct 2 ms 2644 KB Output is correct
22 Correct 2 ms 2644 KB Output is correct
23 Correct 2 ms 2644 KB Output is correct
24 Correct 22 ms 7116 KB Output is correct
25 Correct 20 ms 7132 KB Output is correct
26 Correct 20 ms 7132 KB Output is correct
27 Correct 6 ms 3252 KB Output is correct
28 Correct 6 ms 3284 KB Output is correct
29 Correct 5 ms 3256 KB Output is correct
30 Correct 5 ms 3156 KB Output is correct
31 Correct 8 ms 3128 KB Output is correct
32 Correct 5 ms 3136 KB Output is correct
33 Correct 11 ms 6760 KB Output is correct
34 Correct 11 ms 6760 KB Output is correct
35 Correct 12 ms 6740 KB Output is correct
36 Correct 12 ms 6740 KB Output is correct
37 Correct 12 ms 6772 KB Output is correct
38 Correct 11 ms 6740 KB Output is correct
39 Correct 27 ms 10160 KB Output is correct
40 Correct 28 ms 10188 KB Output is correct
41 Correct 29 ms 10188 KB Output is correct
42 Correct 28 ms 13876 KB Output is correct
43 Correct 18 ms 8744 KB Output is correct
44 Correct 26 ms 14672 KB Output is correct
45 Correct 16 ms 9684 KB Output is correct
46 Correct 16 ms 8708 KB Output is correct
47 Correct 26 ms 14448 KB Output is correct
48 Correct 56 ms 24560 KB Output is correct
49 Correct 35 ms 15664 KB Output is correct
50 Correct 39 ms 17912 KB Output is correct
51 Correct 49 ms 18888 KB Output is correct
52 Correct 65 ms 19932 KB Output is correct
53 Correct 43 ms 17724 KB Output is correct
54 Correct 29 ms 15132 KB Output is correct
55 Correct 29 ms 15140 KB Output is correct
56 Correct 25 ms 14900 KB Output is correct
57 Correct 25 ms 14580 KB Output is correct
58 Correct 25 ms 14588 KB Output is correct
59 Correct 24 ms 14516 KB Output is correct
60 Correct 68 ms 27292 KB Output is correct
61 Correct 73 ms 27400 KB Output is correct
62 Correct 69 ms 27304 KB Output is correct
63 Correct 64 ms 27280 KB Output is correct
64 Correct 64 ms 27288 KB Output is correct
65 Correct 65 ms 27288 KB Output is correct
66 Correct 65 ms 26148 KB Output is correct
67 Correct 87 ms 26248 KB Output is correct
68 Correct 75 ms 26164 KB Output is correct
69 Correct 0 ms 212 KB Output is correct
70 Correct 0 ms 212 KB Output is correct
71 Correct 0 ms 212 KB Output is correct
72 Correct 1 ms 340 KB Output is correct
73 Correct 1 ms 340 KB Output is correct
74 Correct 1 ms 304 KB Output is correct
75 Correct 1 ms 340 KB Output is correct
76 Correct 1 ms 340 KB Output is correct
77 Correct 1 ms 340 KB Output is correct
78 Correct 2 ms 2352 KB Output is correct
79 Correct 1 ms 1876 KB Output is correct
80 Correct 1 ms 1620 KB Output is correct
81 Correct 2 ms 2644 KB Output is correct
82 Correct 2 ms 2132 KB Output is correct
83 Correct 2 ms 2388 KB Output is correct
84 Correct 1 ms 340 KB Output is correct
85 Correct 2 ms 2132 KB Output is correct
86 Correct 1 ms 296 KB Output is correct
87 Correct 2 ms 2516 KB Output is correct
88 Correct 2 ms 2476 KB Output is correct
89 Correct 1 ms 300 KB Output is correct
90 Correct 1 ms 428 KB Output is correct
91 Correct 1 ms 340 KB Output is correct
92 Correct 1 ms 340 KB Output is correct
93 Correct 1 ms 300 KB Output is correct
94 Correct 1 ms 340 KB Output is correct
95 Correct 2 ms 2732 KB Output is correct
96 Correct 2 ms 2772 KB Output is correct
97 Correct 2 ms 2644 KB Output is correct
98 Correct 2 ms 2732 KB Output is correct
99 Correct 2 ms 2772 KB Output is correct
100 Correct 2 ms 2736 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 2 ms 2644 KB Output is correct
106 Correct 1 ms 304 KB Output is correct
107 Correct 1 ms 432 KB Output is correct
108 Correct 1 ms 340 KB Output is correct
109 Correct 1 ms 596 KB Output is correct
110 Correct 1 ms 468 KB Output is correct
111 Correct 2 ms 560 KB Output is correct
112 Correct 3 ms 2548 KB Output is correct
113 Correct 3 ms 2260 KB Output is correct
114 Correct 3 ms 2004 KB Output is correct
115 Correct 2 ms 2132 KB Output is correct
116 Correct 3 ms 2420 KB Output is correct
117 Correct 3 ms 2792 KB Output is correct
118 Correct 22 ms 5196 KB Output is correct
119 Correct 20 ms 6064 KB Output is correct
120 Correct 26 ms 6888 KB Output is correct
121 Correct 2 ms 724 KB Output is correct
122 Correct 2 ms 680 KB Output is correct
123 Correct 2 ms 684 KB Output is correct
124 Correct 2 ms 684 KB Output is correct
125 Correct 2 ms 724 KB Output is correct
126 Correct 4 ms 3028 KB Output is correct
127 Correct 4 ms 3028 KB Output is correct
128 Correct 4 ms 3028 KB Output is correct
129 Correct 4 ms 3028 KB Output is correct
130 Correct 4 ms 3028 KB Output is correct
131 Correct 4 ms 3028 KB Output is correct
132 Correct 30 ms 7328 KB Output is correct
133 Correct 33 ms 7324 KB Output is correct
134 Correct 37 ms 7352 KB Output is correct
135 Correct 6 ms 3284 KB Output is correct
136 Correct 155 ms 38156 KB Output is correct
137 Correct 97 ms 21244 KB Output is correct
138 Correct 79 ms 15956 KB Output is correct
139 Correct 92 ms 18812 KB Output is correct
140 Correct 59 ms 12600 KB Output is correct
141 Correct 14 ms 5668 KB Output is correct
142 Correct 14 ms 5184 KB Output is correct
143 Correct 19 ms 6968 KB Output is correct
144 Correct 15 ms 4948 KB Output is correct
145 Correct 16 ms 5836 KB Output is correct
146 Correct 13 ms 5848 KB Output is correct
147 Correct 20 ms 6220 KB Output is correct
148 Correct 8 ms 2892 KB Output is correct
149 Correct 25 ms 6432 KB Output is correct
150 Correct 6 ms 2748 KB Output is correct
151 Correct 28 ms 8328 KB Output is correct
152 Correct 9 ms 4308 KB Output is correct
153 Correct 9 ms 4672 KB Output is correct
154 Correct 12 ms 5844 KB Output is correct
155 Correct 8 ms 4776 KB Output is correct
156 Correct 8 ms 4308 KB Output is correct
157 Correct 6 ms 3252 KB Output is correct
158 Correct 236 ms 53772 KB Output is correct
159 Correct 180 ms 38560 KB Output is correct
160 Correct 155 ms 32080 KB Output is correct
161 Correct 134 ms 27948 KB Output is correct
162 Correct 117 ms 25328 KB Output is correct
163 Correct 20 ms 7636 KB Output is correct
164 Correct 21 ms 7628 KB Output is correct
165 Correct 22 ms 7592 KB Output is correct
166 Correct 21 ms 7628 KB Output is correct
167 Correct 21 ms 7656 KB Output is correct
168 Correct 21 ms 7648 KB Output is correct
169 Correct 36 ms 10076 KB Output is correct
170 Correct 11 ms 4692 KB Output is correct
171 Correct 36 ms 10040 KB Output is correct
172 Correct 11 ms 4608 KB Output is correct
173 Correct 36 ms 10024 KB Output is correct
174 Correct 11 ms 4692 KB Output is correct
175 Correct 14 ms 6716 KB Output is correct
176 Correct 13 ms 6636 KB Output is correct
177 Correct 12 ms 6612 KB Output is correct
178 Correct 15 ms 6552 KB Output is correct
179 Correct 21 ms 9476 KB Output is correct
180 Correct 915 ms 108360 KB Output is correct
181 Correct 530 ms 122484 KB Output is correct
182 Correct 716 ms 153712 KB Output is correct
183 Correct 345 ms 78492 KB Output is correct
184 Correct 276 ms 65816 KB Output is correct
185 Correct 41 ms 13132 KB Output is correct
186 Correct 38 ms 16552 KB Output is correct
187 Correct 49 ms 15444 KB Output is correct
188 Correct 48 ms 16860 KB Output is correct
189 Correct 49 ms 19008 KB Output is correct
190 Correct 51 ms 16844 KB Output is correct
191 Correct 47 ms 17968 KB Output is correct
192 Correct 38 ms 13328 KB Output is correct
193 Correct 38 ms 14192 KB Output is correct
194 Correct 28 ms 15304 KB Output is correct
195 Execution timed out 1600 ms 266796 KB Time limit exceeded
196 Halted 0 ms 0 KB -