답안 #414338

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
414338 2021-05-30T10:50:50 Z ACmachine 벽 칠하기 (APIO20_paint) C++17
100 / 100
1209 ms 260992 KB
#include "paint.h"

#include <bits/stdc++.h>
using namespace std;

#define FOR(i, j, k, l) for(int i = (j); i < (k); i += (l))
#define FORD(i, j, k, l) for(int i = (j); i>=(k); i -= (l))
#define REP(i, n) FOR(i, 0, n, 1)
#define REPD(i, n) FORD(i, n, 0, 1)
#define pb push_back
typedef long long ll;
const int INF = (int)1e9;
const ll INFF = (ll)1e18;


int minimumInstructions(
    int n, int m, int k, std::vector<int> C, std::vector<int> A, std::vector<std::vector<int>> B) {
    vector<vector<int>> g(k); // which contractors like this color
    REP(i, m){
        for(int x : B[i]){
            g[x].pb(i); // color x is liked by ith contractor too
        }
    }
    vector<vector<int>> starts(m); // for this start as modulo, which ones are okay?
    vector<bool> starts_valid(n, false); // does valid segment start here?
    REP(i, n){
        for(int off : g[C[i]]){
            int start = (off - i);
            start %= m;
            if(start < 0) start += m;
            starts[start].pb(i);
        }
    }
    REP(i, m){
        // if max - min == m - 1; ok
        FOR(j, m - 1, starts[i].size(), 1){
            if(starts[i][j] - starts[i][j - (m - 1)] == m - 1)
                starts_valid[starts[i][j - (m - 1)]] = true;
        } 
    } 
    // I have all valid starts
    vector<int> dp(n + 1, INF);
    multiset<int> se;
    se.insert(0); 
    se.insert(INF + 12); // this last one will not be erased
    dp[0] = 0;
    FOR(i, m, n + 1, 1){
        if(!starts_valid[i - m]){
            if(se.find(dp[i - m]) != se.end())
                se.erase(se.find(dp[i - m]));
            se.insert(dp[i]);
            continue; 
        } 
        /*
        FOR(j,i - m, i, 1){
            dp[i] = min(dp[i], dp[j] + 1);
        }
        */
        dp[i] = *se.begin() + 1;
        if(se.find(dp[i - m]) != se.end())
            se.erase(se.find(dp[i - m]));
        se.insert(dp[i]);
    }
    if(dp[n] >= INF){
        return -1;
    }
    else{
        return dp[n];
    }
    return 0;
}

Compilation message

paint.cpp: In function 'int minimumInstructions(int, int, int, std::vector<int>, std::vector<int>, std::vector<std::vector<int> >)':
paint.cpp:6:44: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    6 | #define FOR(i, j, k, l) for(int i = (j); i < (k); i += (l))
      |                                            ^
paint.cpp:36:9: note: in expansion of macro 'FOR'
   36 |         FOR(j, m - 1, starts[i].size(), 1){
      |         ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 2 ms 2764 KB Output is correct
14 Correct 2 ms 2636 KB Output is correct
15 Correct 2 ms 2636 KB Output is correct
16 Correct 2 ms 2636 KB Output is correct
17 Correct 3 ms 2636 KB Output is correct
18 Correct 2 ms 2636 KB Output is correct
19 Correct 3 ms 2636 KB Output is correct
20 Correct 2 ms 2636 KB Output is correct
21 Correct 3 ms 2636 KB Output is correct
22 Correct 25 ms 6476 KB Output is correct
23 Correct 24 ms 6512 KB Output is correct
24 Correct 25 ms 6592 KB Output is correct
25 Correct 4 ms 588 KB Output is correct
26 Correct 4 ms 588 KB Output is correct
27 Correct 5 ms 588 KB Output is correct
28 Correct 5 ms 588 KB Output is correct
29 Correct 4 ms 588 KB Output is correct
30 Correct 5 ms 588 KB Output is correct
31 Correct 14 ms 3908 KB Output is correct
32 Correct 14 ms 3980 KB Output is correct
33 Correct 14 ms 4028 KB Output is correct
34 Correct 14 ms 3916 KB Output is correct
35 Correct 14 ms 3916 KB Output is correct
36 Correct 14 ms 4008 KB Output is correct
37 Correct 33 ms 7036 KB Output is correct
38 Correct 32 ms 7024 KB Output is correct
39 Correct 32 ms 7080 KB Output is correct
40 Correct 17 ms 1860 KB Output is correct
41 Correct 11 ms 1224 KB Output is correct
42 Correct 20 ms 2008 KB Output is correct
43 Correct 13 ms 1480 KB Output is correct
44 Correct 12 ms 1356 KB Output is correct
45 Correct 20 ms 2124 KB Output is correct
46 Correct 63 ms 15268 KB Output is correct
47 Correct 40 ms 9496 KB Output is correct
48 Correct 41 ms 11760 KB Output is correct
49 Correct 54 ms 12052 KB Output is correct
50 Correct 57 ms 11688 KB Output is correct
51 Correct 46 ms 8516 KB Output is correct
52 Correct 18 ms 1988 KB Output is correct
53 Correct 19 ms 2012 KB Output is correct
54 Correct 21 ms 2012 KB Output is correct
55 Correct 20 ms 2116 KB Output is correct
56 Correct 19 ms 2036 KB Output is correct
57 Correct 20 ms 2124 KB Output is correct
58 Correct 79 ms 16676 KB Output is correct
59 Correct 75 ms 16720 KB Output is correct
60 Correct 77 ms 16648 KB Output is correct
61 Correct 75 ms 16700 KB Output is correct
62 Correct 73 ms 16724 KB Output is correct
63 Correct 74 ms 16660 KB Output is correct
64 Correct 78 ms 14312 KB Output is correct
65 Correct 74 ms 14324 KB Output is correct
66 Correct 75 ms 14320 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 2 ms 2764 KB Output is correct
14 Correct 2 ms 2636 KB Output is correct
15 Correct 2 ms 2636 KB Output is correct
16 Correct 2 ms 2636 KB Output is correct
17 Correct 3 ms 2636 KB Output is correct
18 Correct 2 ms 2636 KB Output is correct
19 Correct 3 ms 2636 KB Output is correct
20 Correct 2 ms 2636 KB Output is correct
21 Correct 3 ms 2636 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 1 ms 204 KB Output is correct
24 Correct 1 ms 204 KB Output is correct
25 Correct 1 ms 204 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
28 Correct 1 ms 332 KB Output is correct
29 Correct 1 ms 332 KB Output is correct
30 Correct 1 ms 332 KB Output is correct
31 Correct 1 ms 204 KB Output is correct
32 Correct 1 ms 332 KB Output is correct
33 Correct 2 ms 2252 KB Output is correct
34 Correct 2 ms 1740 KB Output is correct
35 Correct 2 ms 1612 KB Output is correct
36 Correct 2 ms 2636 KB Output is correct
37 Correct 2 ms 2124 KB Output is correct
38 Correct 2 ms 2380 KB Output is correct
39 Correct 1 ms 204 KB Output is correct
40 Correct 2 ms 2124 KB Output is correct
41 Correct 1 ms 332 KB Output is correct
42 Correct 2 ms 2508 KB Output is correct
43 Correct 2 ms 2380 KB Output is correct
44 Correct 1 ms 204 KB Output is correct
45 Correct 2 ms 332 KB Output is correct
46 Correct 1 ms 332 KB Output is correct
47 Correct 1 ms 332 KB Output is correct
48 Correct 1 ms 332 KB Output is correct
49 Correct 1 ms 332 KB Output is correct
50 Correct 3 ms 2636 KB Output is correct
51 Correct 2 ms 2636 KB Output is correct
52 Correct 2 ms 2636 KB Output is correct
53 Correct 2 ms 2636 KB Output is correct
54 Correct 2 ms 2636 KB Output is correct
55 Correct 2 ms 2636 KB Output is correct
56 Correct 2 ms 2636 KB Output is correct
57 Correct 1 ms 384 KB Output is correct
58 Correct 2 ms 2636 KB Output is correct
59 Correct 1 ms 332 KB Output is correct
60 Correct 3 ms 2636 KB Output is correct
61 Correct 1 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 2 ms 2764 KB Output is correct
16 Correct 2 ms 2636 KB Output is correct
17 Correct 2 ms 2636 KB Output is correct
18 Correct 2 ms 2636 KB Output is correct
19 Correct 3 ms 2636 KB Output is correct
20 Correct 2 ms 2636 KB Output is correct
21 Correct 3 ms 2636 KB Output is correct
22 Correct 2 ms 2636 KB Output is correct
23 Correct 3 ms 2636 KB Output is correct
24 Correct 25 ms 6476 KB Output is correct
25 Correct 24 ms 6512 KB Output is correct
26 Correct 25 ms 6592 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
28 Correct 1 ms 204 KB Output is correct
29 Correct 1 ms 204 KB Output is correct
30 Correct 1 ms 204 KB Output is correct
31 Correct 1 ms 332 KB Output is correct
32 Correct 1 ms 332 KB Output is correct
33 Correct 1 ms 332 KB Output is correct
34 Correct 1 ms 204 KB Output is correct
35 Correct 1 ms 332 KB Output is correct
36 Correct 2 ms 2252 KB Output is correct
37 Correct 2 ms 1740 KB Output is correct
38 Correct 2 ms 1612 KB Output is correct
39 Correct 2 ms 2636 KB Output is correct
40 Correct 2 ms 2124 KB Output is correct
41 Correct 2 ms 2380 KB Output is correct
42 Correct 1 ms 204 KB Output is correct
43 Correct 2 ms 2124 KB Output is correct
44 Correct 1 ms 332 KB Output is correct
45 Correct 2 ms 2508 KB Output is correct
46 Correct 2 ms 2380 KB Output is correct
47 Correct 1 ms 204 KB Output is correct
48 Correct 2 ms 332 KB Output is correct
49 Correct 1 ms 332 KB Output is correct
50 Correct 1 ms 332 KB Output is correct
51 Correct 1 ms 332 KB Output is correct
52 Correct 1 ms 332 KB Output is correct
53 Correct 3 ms 2636 KB Output is correct
54 Correct 2 ms 2636 KB Output is correct
55 Correct 2 ms 2636 KB Output is correct
56 Correct 2 ms 2636 KB Output is correct
57 Correct 2 ms 2636 KB Output is correct
58 Correct 2 ms 2636 KB Output is correct
59 Correct 2 ms 2636 KB Output is correct
60 Correct 1 ms 384 KB Output is correct
61 Correct 2 ms 2636 KB Output is correct
62 Correct 1 ms 332 KB Output is correct
63 Correct 3 ms 2636 KB Output is correct
64 Correct 1 ms 332 KB Output is correct
65 Correct 2 ms 460 KB Output is correct
66 Correct 2 ms 332 KB Output is correct
67 Correct 2 ms 588 KB Output is correct
68 Correct 2 ms 460 KB Output is correct
69 Correct 2 ms 460 KB Output is correct
70 Correct 4 ms 2508 KB Output is correct
71 Correct 4 ms 2124 KB Output is correct
72 Correct 4 ms 1868 KB Output is correct
73 Correct 3 ms 1996 KB Output is correct
74 Correct 4 ms 2380 KB Output is correct
75 Correct 4 ms 2764 KB Output is correct
76 Correct 27 ms 4568 KB Output is correct
77 Correct 24 ms 5316 KB Output is correct
78 Correct 32 ms 5984 KB Output is correct
79 Correct 3 ms 696 KB Output is correct
80 Correct 3 ms 716 KB Output is correct
81 Correct 3 ms 716 KB Output is correct
82 Correct 3 ms 716 KB Output is correct
83 Correct 3 ms 716 KB Output is correct
84 Correct 5 ms 2892 KB Output is correct
85 Correct 5 ms 2892 KB Output is correct
86 Correct 5 ms 2892 KB Output is correct
87 Correct 5 ms 2892 KB Output is correct
88 Correct 5 ms 2892 KB Output is correct
89 Correct 5 ms 2892 KB Output is correct
90 Correct 36 ms 6348 KB Output is correct
91 Correct 37 ms 6300 KB Output is correct
92 Correct 36 ms 6344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 2 ms 2764 KB Output is correct
16 Correct 2 ms 2636 KB Output is correct
17 Correct 2 ms 2636 KB Output is correct
18 Correct 2 ms 2636 KB Output is correct
19 Correct 3 ms 2636 KB Output is correct
20 Correct 2 ms 2636 KB Output is correct
21 Correct 3 ms 2636 KB Output is correct
22 Correct 2 ms 2636 KB Output is correct
23 Correct 3 ms 2636 KB Output is correct
24 Correct 25 ms 6476 KB Output is correct
25 Correct 24 ms 6512 KB Output is correct
26 Correct 25 ms 6592 KB Output is correct
27 Correct 4 ms 588 KB Output is correct
28 Correct 4 ms 588 KB Output is correct
29 Correct 5 ms 588 KB Output is correct
30 Correct 5 ms 588 KB Output is correct
31 Correct 4 ms 588 KB Output is correct
32 Correct 5 ms 588 KB Output is correct
33 Correct 14 ms 3908 KB Output is correct
34 Correct 14 ms 3980 KB Output is correct
35 Correct 14 ms 4028 KB Output is correct
36 Correct 14 ms 3916 KB Output is correct
37 Correct 14 ms 3916 KB Output is correct
38 Correct 14 ms 4008 KB Output is correct
39 Correct 33 ms 7036 KB Output is correct
40 Correct 32 ms 7024 KB Output is correct
41 Correct 32 ms 7080 KB Output is correct
42 Correct 1 ms 204 KB Output is correct
43 Correct 1 ms 204 KB Output is correct
44 Correct 1 ms 204 KB Output is correct
45 Correct 1 ms 204 KB Output is correct
46 Correct 1 ms 332 KB Output is correct
47 Correct 1 ms 332 KB Output is correct
48 Correct 1 ms 332 KB Output is correct
49 Correct 1 ms 204 KB Output is correct
50 Correct 1 ms 332 KB Output is correct
51 Correct 2 ms 2252 KB Output is correct
52 Correct 2 ms 1740 KB Output is correct
53 Correct 2 ms 1612 KB Output is correct
54 Correct 2 ms 2636 KB Output is correct
55 Correct 2 ms 2124 KB Output is correct
56 Correct 2 ms 2380 KB Output is correct
57 Correct 1 ms 204 KB Output is correct
58 Correct 2 ms 2124 KB Output is correct
59 Correct 1 ms 332 KB Output is correct
60 Correct 2 ms 2508 KB Output is correct
61 Correct 2 ms 2380 KB Output is correct
62 Correct 1 ms 204 KB Output is correct
63 Correct 2 ms 332 KB Output is correct
64 Correct 1 ms 332 KB Output is correct
65 Correct 1 ms 332 KB Output is correct
66 Correct 1 ms 332 KB Output is correct
67 Correct 1 ms 332 KB Output is correct
68 Correct 3 ms 2636 KB Output is correct
69 Correct 2 ms 2636 KB Output is correct
70 Correct 2 ms 2636 KB Output is correct
71 Correct 2 ms 2636 KB Output is correct
72 Correct 2 ms 2636 KB Output is correct
73 Correct 2 ms 2636 KB Output is correct
74 Correct 2 ms 2636 KB Output is correct
75 Correct 1 ms 384 KB Output is correct
76 Correct 2 ms 2636 KB Output is correct
77 Correct 1 ms 332 KB Output is correct
78 Correct 3 ms 2636 KB Output is correct
79 Correct 1 ms 332 KB Output is correct
80 Correct 2 ms 460 KB Output is correct
81 Correct 2 ms 332 KB Output is correct
82 Correct 2 ms 588 KB Output is correct
83 Correct 2 ms 460 KB Output is correct
84 Correct 2 ms 460 KB Output is correct
85 Correct 4 ms 2508 KB Output is correct
86 Correct 4 ms 2124 KB Output is correct
87 Correct 4 ms 1868 KB Output is correct
88 Correct 3 ms 1996 KB Output is correct
89 Correct 4 ms 2380 KB Output is correct
90 Correct 4 ms 2764 KB Output is correct
91 Correct 27 ms 4568 KB Output is correct
92 Correct 24 ms 5316 KB Output is correct
93 Correct 32 ms 5984 KB Output is correct
94 Correct 3 ms 696 KB Output is correct
95 Correct 3 ms 716 KB Output is correct
96 Correct 3 ms 716 KB Output is correct
97 Correct 3 ms 716 KB Output is correct
98 Correct 3 ms 716 KB Output is correct
99 Correct 5 ms 2892 KB Output is correct
100 Correct 5 ms 2892 KB Output is correct
101 Correct 5 ms 2892 KB Output is correct
102 Correct 5 ms 2892 KB Output is correct
103 Correct 5 ms 2892 KB Output is correct
104 Correct 5 ms 2892 KB Output is correct
105 Correct 36 ms 6348 KB Output is correct
106 Correct 37 ms 6300 KB Output is correct
107 Correct 36 ms 6344 KB Output is correct
108 Correct 5 ms 716 KB Output is correct
109 Correct 163 ms 39492 KB Output is correct
110 Correct 75 ms 22984 KB Output is correct
111 Correct 60 ms 21584 KB Output is correct
112 Correct 69 ms 24056 KB Output is correct
113 Correct 47 ms 16912 KB Output is correct
114 Correct 17 ms 4172 KB Output is correct
115 Correct 18 ms 3860 KB Output is correct
116 Correct 23 ms 4352 KB Output is correct
117 Correct 17 ms 3504 KB Output is correct
118 Correct 19 ms 4044 KB Output is correct
119 Correct 16 ms 3852 KB Output is correct
120 Correct 25 ms 4432 KB Output is correct
121 Correct 8 ms 1412 KB Output is correct
122 Correct 30 ms 4504 KB Output is correct
123 Correct 7 ms 1228 KB Output is correct
124 Correct 32 ms 5464 KB Output is correct
125 Correct 11 ms 1636 KB Output is correct
126 Correct 10 ms 2636 KB Output is correct
127 Correct 13 ms 3404 KB Output is correct
128 Correct 9 ms 2892 KB Output is correct
129 Correct 9 ms 2380 KB Output is correct
130 Correct 5 ms 716 KB Output is correct
131 Correct 233 ms 67024 KB Output is correct
132 Correct 143 ms 49604 KB Output is correct
133 Correct 113 ms 32836 KB Output is correct
134 Correct 103 ms 33652 KB Output is correct
135 Correct 98 ms 33756 KB Output is correct
136 Correct 25 ms 4684 KB Output is correct
137 Correct 25 ms 4784 KB Output is correct
138 Correct 25 ms 4716 KB Output is correct
139 Correct 25 ms 4676 KB Output is correct
140 Correct 26 ms 4724 KB Output is correct
141 Correct 25 ms 4704 KB Output is correct
142 Correct 43 ms 6972 KB Output is correct
143 Correct 13 ms 1996 KB Output is correct
144 Correct 43 ms 7020 KB Output is correct
145 Correct 14 ms 2072 KB Output is correct
146 Correct 43 ms 6980 KB Output is correct
147 Correct 13 ms 1996 KB Output is correct
148 Correct 14 ms 4044 KB Output is correct
149 Correct 14 ms 3916 KB Output is correct
150 Correct 16 ms 3956 KB Output is correct
151 Correct 16 ms 3904 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 2 ms 2764 KB Output is correct
16 Correct 2 ms 2636 KB Output is correct
17 Correct 2 ms 2636 KB Output is correct
18 Correct 2 ms 2636 KB Output is correct
19 Correct 3 ms 2636 KB Output is correct
20 Correct 2 ms 2636 KB Output is correct
21 Correct 3 ms 2636 KB Output is correct
22 Correct 2 ms 2636 KB Output is correct
23 Correct 3 ms 2636 KB Output is correct
24 Correct 25 ms 6476 KB Output is correct
25 Correct 24 ms 6512 KB Output is correct
26 Correct 25 ms 6592 KB Output is correct
27 Correct 4 ms 588 KB Output is correct
28 Correct 4 ms 588 KB Output is correct
29 Correct 5 ms 588 KB Output is correct
30 Correct 5 ms 588 KB Output is correct
31 Correct 4 ms 588 KB Output is correct
32 Correct 5 ms 588 KB Output is correct
33 Correct 14 ms 3908 KB Output is correct
34 Correct 14 ms 3980 KB Output is correct
35 Correct 14 ms 4028 KB Output is correct
36 Correct 14 ms 3916 KB Output is correct
37 Correct 14 ms 3916 KB Output is correct
38 Correct 14 ms 4008 KB Output is correct
39 Correct 33 ms 7036 KB Output is correct
40 Correct 32 ms 7024 KB Output is correct
41 Correct 32 ms 7080 KB Output is correct
42 Correct 17 ms 1860 KB Output is correct
43 Correct 11 ms 1224 KB Output is correct
44 Correct 20 ms 2008 KB Output is correct
45 Correct 13 ms 1480 KB Output is correct
46 Correct 12 ms 1356 KB Output is correct
47 Correct 20 ms 2124 KB Output is correct
48 Correct 63 ms 15268 KB Output is correct
49 Correct 40 ms 9496 KB Output is correct
50 Correct 41 ms 11760 KB Output is correct
51 Correct 54 ms 12052 KB Output is correct
52 Correct 57 ms 11688 KB Output is correct
53 Correct 46 ms 8516 KB Output is correct
54 Correct 18 ms 1988 KB Output is correct
55 Correct 19 ms 2012 KB Output is correct
56 Correct 21 ms 2012 KB Output is correct
57 Correct 20 ms 2116 KB Output is correct
58 Correct 19 ms 2036 KB Output is correct
59 Correct 20 ms 2124 KB Output is correct
60 Correct 79 ms 16676 KB Output is correct
61 Correct 75 ms 16720 KB Output is correct
62 Correct 77 ms 16648 KB Output is correct
63 Correct 75 ms 16700 KB Output is correct
64 Correct 73 ms 16724 KB Output is correct
65 Correct 74 ms 16660 KB Output is correct
66 Correct 78 ms 14312 KB Output is correct
67 Correct 74 ms 14324 KB Output is correct
68 Correct 75 ms 14320 KB Output is correct
69 Correct 1 ms 204 KB Output is correct
70 Correct 1 ms 204 KB Output is correct
71 Correct 1 ms 204 KB Output is correct
72 Correct 1 ms 204 KB Output is correct
73 Correct 1 ms 332 KB Output is correct
74 Correct 1 ms 332 KB Output is correct
75 Correct 1 ms 332 KB Output is correct
76 Correct 1 ms 204 KB Output is correct
77 Correct 1 ms 332 KB Output is correct
78 Correct 2 ms 2252 KB Output is correct
79 Correct 2 ms 1740 KB Output is correct
80 Correct 2 ms 1612 KB Output is correct
81 Correct 2 ms 2636 KB Output is correct
82 Correct 2 ms 2124 KB Output is correct
83 Correct 2 ms 2380 KB Output is correct
84 Correct 1 ms 204 KB Output is correct
85 Correct 2 ms 2124 KB Output is correct
86 Correct 1 ms 332 KB Output is correct
87 Correct 2 ms 2508 KB Output is correct
88 Correct 2 ms 2380 KB Output is correct
89 Correct 1 ms 204 KB Output is correct
90 Correct 2 ms 332 KB Output is correct
91 Correct 1 ms 332 KB Output is correct
92 Correct 1 ms 332 KB Output is correct
93 Correct 1 ms 332 KB Output is correct
94 Correct 1 ms 332 KB Output is correct
95 Correct 3 ms 2636 KB Output is correct
96 Correct 2 ms 2636 KB Output is correct
97 Correct 2 ms 2636 KB Output is correct
98 Correct 2 ms 2636 KB Output is correct
99 Correct 2 ms 2636 KB Output is correct
100 Correct 2 ms 2636 KB Output is correct
101 Correct 2 ms 2636 KB Output is correct
102 Correct 1 ms 384 KB Output is correct
103 Correct 2 ms 2636 KB Output is correct
104 Correct 1 ms 332 KB Output is correct
105 Correct 3 ms 2636 KB Output is correct
106 Correct 1 ms 332 KB Output is correct
107 Correct 2 ms 460 KB Output is correct
108 Correct 2 ms 332 KB Output is correct
109 Correct 2 ms 588 KB Output is correct
110 Correct 2 ms 460 KB Output is correct
111 Correct 2 ms 460 KB Output is correct
112 Correct 4 ms 2508 KB Output is correct
113 Correct 4 ms 2124 KB Output is correct
114 Correct 4 ms 1868 KB Output is correct
115 Correct 3 ms 1996 KB Output is correct
116 Correct 4 ms 2380 KB Output is correct
117 Correct 4 ms 2764 KB Output is correct
118 Correct 27 ms 4568 KB Output is correct
119 Correct 24 ms 5316 KB Output is correct
120 Correct 32 ms 5984 KB Output is correct
121 Correct 3 ms 696 KB Output is correct
122 Correct 3 ms 716 KB Output is correct
123 Correct 3 ms 716 KB Output is correct
124 Correct 3 ms 716 KB Output is correct
125 Correct 3 ms 716 KB Output is correct
126 Correct 5 ms 2892 KB Output is correct
127 Correct 5 ms 2892 KB Output is correct
128 Correct 5 ms 2892 KB Output is correct
129 Correct 5 ms 2892 KB Output is correct
130 Correct 5 ms 2892 KB Output is correct
131 Correct 5 ms 2892 KB Output is correct
132 Correct 36 ms 6348 KB Output is correct
133 Correct 37 ms 6300 KB Output is correct
134 Correct 36 ms 6344 KB Output is correct
135 Correct 5 ms 716 KB Output is correct
136 Correct 163 ms 39492 KB Output is correct
137 Correct 75 ms 22984 KB Output is correct
138 Correct 60 ms 21584 KB Output is correct
139 Correct 69 ms 24056 KB Output is correct
140 Correct 47 ms 16912 KB Output is correct
141 Correct 17 ms 4172 KB Output is correct
142 Correct 18 ms 3860 KB Output is correct
143 Correct 23 ms 4352 KB Output is correct
144 Correct 17 ms 3504 KB Output is correct
145 Correct 19 ms 4044 KB Output is correct
146 Correct 16 ms 3852 KB Output is correct
147 Correct 25 ms 4432 KB Output is correct
148 Correct 8 ms 1412 KB Output is correct
149 Correct 30 ms 4504 KB Output is correct
150 Correct 7 ms 1228 KB Output is correct
151 Correct 32 ms 5464 KB Output is correct
152 Correct 11 ms 1636 KB Output is correct
153 Correct 10 ms 2636 KB Output is correct
154 Correct 13 ms 3404 KB Output is correct
155 Correct 9 ms 2892 KB Output is correct
156 Correct 9 ms 2380 KB Output is correct
157 Correct 5 ms 716 KB Output is correct
158 Correct 233 ms 67024 KB Output is correct
159 Correct 143 ms 49604 KB Output is correct
160 Correct 113 ms 32836 KB Output is correct
161 Correct 103 ms 33652 KB Output is correct
162 Correct 98 ms 33756 KB Output is correct
163 Correct 25 ms 4684 KB Output is correct
164 Correct 25 ms 4784 KB Output is correct
165 Correct 25 ms 4716 KB Output is correct
166 Correct 25 ms 4676 KB Output is correct
167 Correct 26 ms 4724 KB Output is correct
168 Correct 25 ms 4704 KB Output is correct
169 Correct 43 ms 6972 KB Output is correct
170 Correct 13 ms 1996 KB Output is correct
171 Correct 43 ms 7020 KB Output is correct
172 Correct 14 ms 2072 KB Output is correct
173 Correct 43 ms 6980 KB Output is correct
174 Correct 13 ms 1996 KB Output is correct
175 Correct 14 ms 4044 KB Output is correct
176 Correct 14 ms 3916 KB Output is correct
177 Correct 16 ms 3956 KB Output is correct
178 Correct 16 ms 3904 KB Output is correct
179 Correct 13 ms 1552 KB Output is correct
180 Correct 473 ms 107764 KB Output is correct
181 Correct 481 ms 141164 KB Output is correct
182 Correct 610 ms 176028 KB Output is correct
183 Correct 303 ms 98884 KB Output is correct
184 Correct 250 ms 73612 KB Output is correct
185 Correct 46 ms 5876 KB Output is correct
186 Correct 45 ms 8776 KB Output is correct
187 Correct 56 ms 7084 KB Output is correct
188 Correct 50 ms 6660 KB Output is correct
189 Correct 55 ms 7156 KB Output is correct
190 Correct 68 ms 8108 KB Output is correct
191 Correct 59 ms 8880 KB Output is correct
192 Correct 38 ms 5620 KB Output is correct
193 Correct 38 ms 5192 KB Output is correct
194 Correct 21 ms 2392 KB Output is correct
195 Correct 1209 ms 260992 KB Output is correct
196 Correct 759 ms 201676 KB Output is correct
197 Correct 640 ms 190480 KB Output is correct
198 Correct 534 ms 157380 KB Output is correct
199 Correct 501 ms 160416 KB Output is correct
200 Correct 96 ms 18948 KB Output is correct
201 Correct 98 ms 18944 KB Output is correct
202 Correct 100 ms 18924 KB Output is correct
203 Correct 97 ms 18948 KB Output is correct
204 Correct 101 ms 18920 KB Output is correct
205 Correct 96 ms 18856 KB Output is correct
206 Correct 93 ms 16452 KB Output is correct
207 Correct 90 ms 18196 KB Output is correct
208 Correct 96 ms 16376 KB Output is correct
209 Correct 88 ms 18204 KB Output is correct
210 Correct 91 ms 16412 KB Output is correct
211 Correct 87 ms 18236 KB Output is correct
212 Correct 73 ms 16196 KB Output is correct
213 Correct 66 ms 12812 KB Output is correct
214 Correct 64 ms 12100 KB Output is correct
215 Correct 68 ms 11912 KB Output is correct