답안 #740032

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
740032 2023-05-12T01:28:56 Z becaido 벽 칠하기 (APIO20_paint) C++17
100 / 100
1247 ms 18828 KB
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,popcnt,sse4,abm")
#include <bits/stdc++.h>
using namespace std;

#ifndef WAIMAI
#include "paint.h"
#endif

#ifdef WAIMAI
#define debug(HEHE...) cout << "[" << #HEHE << "] : ", dout(HEHE)
void dout() {cout << '\n';}
template<typename T, typename...U>
void dout(T t, U...u) {cout << t << (sizeof...(u) ? ", " : ""), dout(u...);}
#else
#define debug(...) 7122
#endif

#define ll long long
#define Waimai ios::sync_with_stdio(false), cin.tie(0)
#define FOR(x,a,b) for (int x = a, I = b; x <= I; x++)
#define pb emplace_back
#define F first
#define S second

const int SIZE = 1e5 + 5;

int n, m, k, ans;
int a[SIZE];
vector<int> v[SIZE], p[SIZE];
bool valid[SIZE];
int mx, cnt[SIZE], bnt[SIZE], dp[SIZE];

void add(int x) {
    debug("add", x);
    bnt[cnt[x]]--;
    cnt[x]++;
    bnt[cnt[x]]++;
    mx = max(mx, cnt[x]);
}
void del(int x) {
    debug("del", x);
    bnt[cnt[x]]--;
    if (mx == cnt[x] && bnt[cnt[x]] == 0) mx--;
    cnt[x]--;
    bnt[cnt[x]]++;
}

int minimumInstructions(int N, int M, int K, vector<int> C, vector<int> A, vector<vector<int>> B) {
    n = N, m = M, k = K;
    FOR (i, 1, n) a[i] = C[i - 1] + 1;
    FOR (i, 1, m) {
        v[i] = B[i - 1];
        for (int &x : v[i]) {
            x++;
            p[x].pb(i);
        }
    }
    FOR (i, 1, n) if (p[a[i]].size() == 0) return -1;
    bnt[0] = k;
    FOR (i, 1, n) {
        for (int pos : p[a[i]]) {
            pos -= i;
            pos %= m;
            if (pos <= 0) pos += m;
            add(pos);
        }
        if (i > m) {
            for (int pos : p[a[i - m]]) {
                pos -= i - m;
                pos %= m;
                if (pos <= 0) pos += m;
                del(pos);
            }
        }
        debug(i, mx);
        if (mx == m) valid[i - m + 1] = 1;
    }
    if (!valid[1] || !valid[n - m + 1]) return debug("test"), -1;
    int cur = 0, mx = 0;
    FOR (i, 1, n) {
        if (valid[i]) debug(i), mx = i + m - 1;
        if (i > mx) return -1;
        if (i > cur) {
            ans++;
            cur = mx;
        }
    }
    return ans;
}

/*in1
8 3 5
3 3 1 3 4 4 2 2
3 0 1 2
2 2 3
2 3 4
out1
3
in2
5 4 4
1 0 1 2 2
2 0 1
1 1
1 2
1 3
out2
-1
*/

#ifdef WAIMAI
int main() {
  int N, M, K;
  assert(3 == scanf("%d %d %d", &N, &M, &K));

  vector<int> C(N);
  for (int i = 0; i < N; ++i) {
    assert(1 == scanf("%d", &C[i]));
  }

  vector<int> A(M);
  vector<vector<int>> B(M);
  for (int i = 0; i < M; ++i) {
    assert(1 == scanf("%d", &A[i]));
    B[i].resize(A[i]);
    for (int j = 0; j < A[i]; ++j) {
      assert(1 == scanf("%d", &B[i][j]));
    }
  }

  int minimum_instructions = minimumInstructions(N, M, K, C, A, B);
  printf("%d\n", minimum_instructions);

  return 0;
}
#endif

Compilation message

paint.cpp: In function 'void add(int)':
paint.cpp:16:20: warning: statement has no effect [-Wunused-value]
   16 | #define debug(...) 7122
      |                    ^~~~
paint.cpp:35:5: note: in expansion of macro 'debug'
   35 |     debug("add", x);
      |     ^~~~~
paint.cpp: In function 'void del(int)':
paint.cpp:16:20: warning: statement has no effect [-Wunused-value]
   16 | #define debug(...) 7122
      |                    ^~~~
paint.cpp:42:5: note: in expansion of macro 'debug'
   42 |     debug("del", x);
      |     ^~~~~
paint.cpp: In function 'int minimumInstructions(int, int, int, std::vector<int>, std::vector<int>, std::vector<std::vector<int> >)':
paint.cpp:16:20: warning: statement has no effect [-Wunused-value]
   16 | #define debug(...) 7122
      |                    ^~~~
paint.cpp:76:9: note: in expansion of macro 'debug'
   76 |         debug(i, mx);
      |         ^~~~~
paint.cpp:16:20: warning: left operand of comma operator has no effect [-Wunused-value]
   16 | #define debug(...) 7122
      |                    ^~~~
paint.cpp:79:48: note: in expansion of macro 'debug'
   79 |     if (!valid[1] || !valid[n - m + 1]) return debug("test"), -1;
      |                                                ^~~~~
paint.cpp:16:20: warning: left operand of comma operator has no effect [-Wunused-value]
   16 | #define debug(...) 7122
      |                    ^~~~
paint.cpp:82:23: note: in expansion of macro 'debug'
   82 |         if (valid[i]) debug(i), mx = i + m - 1;
      |                       ^~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 4948 KB Output is correct
2 Correct 3 ms 4948 KB Output is correct
3 Correct 3 ms 5008 KB Output is correct
4 Correct 3 ms 4948 KB Output is correct
5 Correct 3 ms 5008 KB Output is correct
6 Correct 4 ms 4948 KB Output is correct
7 Correct 4 ms 5012 KB Output is correct
8 Correct 4 ms 4948 KB Output is correct
9 Correct 3 ms 4948 KB Output is correct
10 Correct 4 ms 4948 KB Output is correct
11 Correct 3 ms 4948 KB Output is correct
12 Correct 3 ms 5008 KB Output is correct
13 Correct 4 ms 5016 KB Output is correct
14 Correct 3 ms 5076 KB Output is correct
15 Correct 4 ms 5076 KB Output is correct
16 Correct 4 ms 5016 KB Output is correct
17 Correct 4 ms 5076 KB Output is correct
18 Correct 3 ms 5016 KB Output is correct
19 Correct 4 ms 5020 KB Output is correct
20 Correct 3 ms 5076 KB Output is correct
21 Correct 4 ms 5076 KB Output is correct
22 Correct 22 ms 9868 KB Output is correct
23 Correct 21 ms 9800 KB Output is correct
24 Correct 22 ms 9864 KB Output is correct
25 Correct 5 ms 5204 KB Output is correct
26 Correct 6 ms 5204 KB Output is correct
27 Correct 6 ms 5260 KB Output is correct
28 Correct 6 ms 5204 KB Output is correct
29 Correct 6 ms 5204 KB Output is correct
30 Correct 6 ms 5204 KB Output is correct
31 Correct 10 ms 6420 KB Output is correct
32 Correct 11 ms 6484 KB Output is correct
33 Correct 10 ms 6532 KB Output is correct
34 Correct 10 ms 6476 KB Output is correct
35 Correct 11 ms 6532 KB Output is correct
36 Correct 10 ms 6508 KB Output is correct
37 Correct 28 ms 10380 KB Output is correct
38 Correct 27 ms 10312 KB Output is correct
39 Correct 30 ms 10448 KB Output is correct
40 Correct 14 ms 6324 KB Output is correct
41 Correct 11 ms 5844 KB Output is correct
42 Correct 16 ms 6356 KB Output is correct
43 Correct 11 ms 5916 KB Output is correct
44 Correct 12 ms 5892 KB Output is correct
45 Correct 14 ms 6376 KB Output is correct
46 Correct 46 ms 17144 KB Output is correct
47 Correct 30 ms 11724 KB Output is correct
48 Correct 34 ms 15140 KB Output is correct
49 Correct 41 ms 15180 KB Output is correct
50 Correct 48 ms 14764 KB Output is correct
51 Correct 40 ms 11956 KB Output is correct
52 Correct 14 ms 6480 KB Output is correct
53 Correct 13 ms 6432 KB Output is correct
54 Correct 14 ms 6380 KB Output is correct
55 Correct 14 ms 6484 KB Output is correct
56 Correct 15 ms 6428 KB Output is correct
57 Correct 14 ms 6436 KB Output is correct
58 Correct 50 ms 18112 KB Output is correct
59 Correct 52 ms 18240 KB Output is correct
60 Correct 51 ms 18124 KB Output is correct
61 Correct 53 ms 18132 KB Output is correct
62 Correct 54 ms 18192 KB Output is correct
63 Correct 55 ms 18208 KB Output is correct
64 Correct 56 ms 17176 KB Output is correct
65 Correct 64 ms 17176 KB Output is correct
66 Correct 64 ms 17180 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 4948 KB Output is correct
2 Correct 3 ms 4948 KB Output is correct
3 Correct 3 ms 5008 KB Output is correct
4 Correct 3 ms 4948 KB Output is correct
5 Correct 3 ms 5008 KB Output is correct
6 Correct 4 ms 4948 KB Output is correct
7 Correct 4 ms 5012 KB Output is correct
8 Correct 4 ms 4948 KB Output is correct
9 Correct 3 ms 4948 KB Output is correct
10 Correct 4 ms 4948 KB Output is correct
11 Correct 3 ms 4948 KB Output is correct
12 Correct 3 ms 5008 KB Output is correct
13 Correct 4 ms 5016 KB Output is correct
14 Correct 3 ms 5076 KB Output is correct
15 Correct 4 ms 5076 KB Output is correct
16 Correct 4 ms 5016 KB Output is correct
17 Correct 4 ms 5076 KB Output is correct
18 Correct 3 ms 5016 KB Output is correct
19 Correct 4 ms 5020 KB Output is correct
20 Correct 3 ms 5076 KB Output is correct
21 Correct 4 ms 5076 KB Output is correct
22 Correct 3 ms 4948 KB Output is correct
23 Correct 3 ms 5004 KB Output is correct
24 Correct 3 ms 5008 KB Output is correct
25 Correct 3 ms 4948 KB Output is correct
26 Correct 4 ms 5004 KB Output is correct
27 Correct 3 ms 4948 KB Output is correct
28 Correct 3 ms 4948 KB Output is correct
29 Correct 4 ms 5016 KB Output is correct
30 Correct 3 ms 4948 KB Output is correct
31 Correct 3 ms 4948 KB Output is correct
32 Correct 3 ms 5012 KB Output is correct
33 Correct 3 ms 4976 KB Output is correct
34 Correct 3 ms 4948 KB Output is correct
35 Correct 3 ms 4948 KB Output is correct
36 Correct 3 ms 4948 KB Output is correct
37 Correct 4 ms 5004 KB Output is correct
38 Correct 3 ms 4948 KB Output is correct
39 Correct 4 ms 4948 KB Output is correct
40 Correct 4 ms 5076 KB Output is correct
41 Correct 3 ms 4948 KB Output is correct
42 Correct 4 ms 4948 KB Output is correct
43 Correct 3 ms 4948 KB Output is correct
44 Correct 3 ms 4948 KB Output is correct
45 Correct 4 ms 5016 KB Output is correct
46 Correct 3 ms 5008 KB Output is correct
47 Correct 3 ms 4948 KB Output is correct
48 Correct 3 ms 4948 KB Output is correct
49 Correct 3 ms 4948 KB Output is correct
50 Correct 4 ms 5012 KB Output is correct
51 Correct 3 ms 5076 KB Output is correct
52 Correct 3 ms 5016 KB Output is correct
53 Correct 3 ms 5076 KB Output is correct
54 Correct 3 ms 5016 KB Output is correct
55 Correct 3 ms 5076 KB Output is correct
56 Correct 5 ms 5076 KB Output is correct
57 Correct 4 ms 5076 KB Output is correct
58 Correct 4 ms 5076 KB Output is correct
59 Correct 4 ms 5016 KB Output is correct
60 Correct 4 ms 5020 KB Output is correct
61 Correct 3 ms 5076 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 4948 KB Output is correct
2 Correct 3 ms 5004 KB Output is correct
3 Correct 3 ms 4948 KB Output is correct
4 Correct 3 ms 4948 KB Output is correct
5 Correct 3 ms 5008 KB Output is correct
6 Correct 3 ms 4948 KB Output is correct
7 Correct 3 ms 5008 KB Output is correct
8 Correct 4 ms 4948 KB Output is correct
9 Correct 4 ms 5012 KB Output is correct
10 Correct 4 ms 4948 KB Output is correct
11 Correct 3 ms 4948 KB Output is correct
12 Correct 4 ms 4948 KB Output is correct
13 Correct 3 ms 4948 KB Output is correct
14 Correct 3 ms 5008 KB Output is correct
15 Correct 4 ms 5016 KB Output is correct
16 Correct 3 ms 5076 KB Output is correct
17 Correct 4 ms 5076 KB Output is correct
18 Correct 4 ms 5016 KB Output is correct
19 Correct 4 ms 5076 KB Output is correct
20 Correct 3 ms 5016 KB Output is correct
21 Correct 4 ms 5020 KB Output is correct
22 Correct 3 ms 5076 KB Output is correct
23 Correct 4 ms 5076 KB Output is correct
24 Correct 22 ms 9868 KB Output is correct
25 Correct 21 ms 9800 KB Output is correct
26 Correct 22 ms 9864 KB Output is correct
27 Correct 3 ms 5008 KB Output is correct
28 Correct 3 ms 4948 KB Output is correct
29 Correct 4 ms 5004 KB Output is correct
30 Correct 3 ms 4948 KB Output is correct
31 Correct 3 ms 4948 KB Output is correct
32 Correct 4 ms 5016 KB Output is correct
33 Correct 3 ms 4948 KB Output is correct
34 Correct 3 ms 4948 KB Output is correct
35 Correct 3 ms 5012 KB Output is correct
36 Correct 3 ms 4976 KB Output is correct
37 Correct 3 ms 4948 KB Output is correct
38 Correct 3 ms 4948 KB Output is correct
39 Correct 3 ms 4948 KB Output is correct
40 Correct 4 ms 5004 KB Output is correct
41 Correct 3 ms 4948 KB Output is correct
42 Correct 4 ms 4948 KB Output is correct
43 Correct 4 ms 5076 KB Output is correct
44 Correct 3 ms 4948 KB Output is correct
45 Correct 4 ms 4948 KB Output is correct
46 Correct 3 ms 4948 KB Output is correct
47 Correct 3 ms 4948 KB Output is correct
48 Correct 4 ms 5016 KB Output is correct
49 Correct 3 ms 5008 KB Output is correct
50 Correct 3 ms 4948 KB Output is correct
51 Correct 3 ms 4948 KB Output is correct
52 Correct 3 ms 4948 KB Output is correct
53 Correct 4 ms 5012 KB Output is correct
54 Correct 3 ms 5076 KB Output is correct
55 Correct 3 ms 5016 KB Output is correct
56 Correct 3 ms 5076 KB Output is correct
57 Correct 3 ms 5016 KB Output is correct
58 Correct 3 ms 5076 KB Output is correct
59 Correct 5 ms 5076 KB Output is correct
60 Correct 4 ms 5076 KB Output is correct
61 Correct 4 ms 5076 KB Output is correct
62 Correct 4 ms 5016 KB Output is correct
63 Correct 4 ms 5020 KB Output is correct
64 Correct 3 ms 5076 KB Output is correct
65 Correct 4 ms 4948 KB Output is correct
66 Correct 3 ms 5044 KB Output is correct
67 Correct 5 ms 4948 KB Output is correct
68 Correct 4 ms 5008 KB Output is correct
69 Correct 4 ms 5012 KB Output is correct
70 Correct 5 ms 5276 KB Output is correct
71 Correct 5 ms 5276 KB Output is correct
72 Correct 5 ms 5204 KB Output is correct
73 Correct 4 ms 5076 KB Output is correct
74 Correct 5 ms 5212 KB Output is correct
75 Correct 5 ms 5152 KB Output is correct
76 Correct 23 ms 8680 KB Output is correct
77 Correct 20 ms 9256 KB Output is correct
78 Correct 27 ms 9776 KB Output is correct
79 Correct 6 ms 4948 KB Output is correct
80 Correct 6 ms 5008 KB Output is correct
81 Correct 5 ms 5072 KB Output is correct
82 Correct 5 ms 4948 KB Output is correct
83 Correct 6 ms 4948 KB Output is correct
84 Correct 6 ms 5404 KB Output is correct
85 Correct 6 ms 5404 KB Output is correct
86 Correct 6 ms 5360 KB Output is correct
87 Correct 6 ms 5408 KB Output is correct
88 Correct 6 ms 5460 KB Output is correct
89 Correct 5 ms 5412 KB Output is correct
90 Correct 31 ms 10240 KB Output is correct
91 Correct 29 ms 10188 KB Output is correct
92 Correct 29 ms 10268 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 4948 KB Output is correct
2 Correct 3 ms 5004 KB Output is correct
3 Correct 3 ms 4948 KB Output is correct
4 Correct 3 ms 4948 KB Output is correct
5 Correct 3 ms 5008 KB Output is correct
6 Correct 3 ms 4948 KB Output is correct
7 Correct 3 ms 5008 KB Output is correct
8 Correct 4 ms 4948 KB Output is correct
9 Correct 4 ms 5012 KB Output is correct
10 Correct 4 ms 4948 KB Output is correct
11 Correct 3 ms 4948 KB Output is correct
12 Correct 4 ms 4948 KB Output is correct
13 Correct 3 ms 4948 KB Output is correct
14 Correct 3 ms 5008 KB Output is correct
15 Correct 4 ms 5016 KB Output is correct
16 Correct 3 ms 5076 KB Output is correct
17 Correct 4 ms 5076 KB Output is correct
18 Correct 4 ms 5016 KB Output is correct
19 Correct 4 ms 5076 KB Output is correct
20 Correct 3 ms 5016 KB Output is correct
21 Correct 4 ms 5020 KB Output is correct
22 Correct 3 ms 5076 KB Output is correct
23 Correct 4 ms 5076 KB Output is correct
24 Correct 22 ms 9868 KB Output is correct
25 Correct 21 ms 9800 KB Output is correct
26 Correct 22 ms 9864 KB Output is correct
27 Correct 5 ms 5204 KB Output is correct
28 Correct 6 ms 5204 KB Output is correct
29 Correct 6 ms 5260 KB Output is correct
30 Correct 6 ms 5204 KB Output is correct
31 Correct 6 ms 5204 KB Output is correct
32 Correct 6 ms 5204 KB Output is correct
33 Correct 10 ms 6420 KB Output is correct
34 Correct 11 ms 6484 KB Output is correct
35 Correct 10 ms 6532 KB Output is correct
36 Correct 10 ms 6476 KB Output is correct
37 Correct 11 ms 6532 KB Output is correct
38 Correct 10 ms 6508 KB Output is correct
39 Correct 28 ms 10380 KB Output is correct
40 Correct 27 ms 10312 KB Output is correct
41 Correct 30 ms 10448 KB Output is correct
42 Correct 3 ms 5008 KB Output is correct
43 Correct 3 ms 4948 KB Output is correct
44 Correct 4 ms 5004 KB Output is correct
45 Correct 3 ms 4948 KB Output is correct
46 Correct 3 ms 4948 KB Output is correct
47 Correct 4 ms 5016 KB Output is correct
48 Correct 3 ms 4948 KB Output is correct
49 Correct 3 ms 4948 KB Output is correct
50 Correct 3 ms 5012 KB Output is correct
51 Correct 3 ms 4976 KB Output is correct
52 Correct 3 ms 4948 KB Output is correct
53 Correct 3 ms 4948 KB Output is correct
54 Correct 3 ms 4948 KB Output is correct
55 Correct 4 ms 5004 KB Output is correct
56 Correct 3 ms 4948 KB Output is correct
57 Correct 4 ms 4948 KB Output is correct
58 Correct 4 ms 5076 KB Output is correct
59 Correct 3 ms 4948 KB Output is correct
60 Correct 4 ms 4948 KB Output is correct
61 Correct 3 ms 4948 KB Output is correct
62 Correct 3 ms 4948 KB Output is correct
63 Correct 4 ms 5016 KB Output is correct
64 Correct 3 ms 5008 KB Output is correct
65 Correct 3 ms 4948 KB Output is correct
66 Correct 3 ms 4948 KB Output is correct
67 Correct 3 ms 4948 KB Output is correct
68 Correct 4 ms 5012 KB Output is correct
69 Correct 3 ms 5076 KB Output is correct
70 Correct 3 ms 5016 KB Output is correct
71 Correct 3 ms 5076 KB Output is correct
72 Correct 3 ms 5016 KB Output is correct
73 Correct 3 ms 5076 KB Output is correct
74 Correct 5 ms 5076 KB Output is correct
75 Correct 4 ms 5076 KB Output is correct
76 Correct 4 ms 5076 KB Output is correct
77 Correct 4 ms 5016 KB Output is correct
78 Correct 4 ms 5020 KB Output is correct
79 Correct 3 ms 5076 KB Output is correct
80 Correct 4 ms 4948 KB Output is correct
81 Correct 3 ms 5044 KB Output is correct
82 Correct 5 ms 4948 KB Output is correct
83 Correct 4 ms 5008 KB Output is correct
84 Correct 4 ms 5012 KB Output is correct
85 Correct 5 ms 5276 KB Output is correct
86 Correct 5 ms 5276 KB Output is correct
87 Correct 5 ms 5204 KB Output is correct
88 Correct 4 ms 5076 KB Output is correct
89 Correct 5 ms 5212 KB Output is correct
90 Correct 5 ms 5152 KB Output is correct
91 Correct 23 ms 8680 KB Output is correct
92 Correct 20 ms 9256 KB Output is correct
93 Correct 27 ms 9776 KB Output is correct
94 Correct 6 ms 4948 KB Output is correct
95 Correct 6 ms 5008 KB Output is correct
96 Correct 5 ms 5072 KB Output is correct
97 Correct 5 ms 4948 KB Output is correct
98 Correct 6 ms 4948 KB Output is correct
99 Correct 6 ms 5404 KB Output is correct
100 Correct 6 ms 5404 KB Output is correct
101 Correct 6 ms 5360 KB Output is correct
102 Correct 6 ms 5408 KB Output is correct
103 Correct 6 ms 5460 KB Output is correct
104 Correct 5 ms 5412 KB Output is correct
105 Correct 31 ms 10240 KB Output is correct
106 Correct 29 ms 10188 KB Output is correct
107 Correct 29 ms 10268 KB Output is correct
108 Correct 6 ms 5204 KB Output is correct
109 Correct 186 ms 5400 KB Output is correct
110 Correct 102 ms 5280 KB Output is correct
111 Correct 70 ms 5276 KB Output is correct
112 Correct 63 ms 5344 KB Output is correct
113 Correct 59 ms 5332 KB Output is correct
114 Correct 15 ms 6868 KB Output is correct
115 Correct 16 ms 6712 KB Output is correct
116 Correct 20 ms 7192 KB Output is correct
117 Correct 15 ms 6868 KB Output is correct
118 Correct 17 ms 7072 KB Output is correct
119 Correct 14 ms 6628 KB Output is correct
120 Correct 22 ms 8464 KB Output is correct
121 Correct 7 ms 5716 KB Output is correct
122 Correct 24 ms 8868 KB Output is correct
123 Correct 7 ms 5588 KB Output is correct
124 Correct 27 ms 9412 KB Output is correct
125 Correct 9 ms 5972 KB Output is correct
126 Correct 10 ms 6100 KB Output is correct
127 Correct 13 ms 6376 KB Output is correct
128 Correct 9 ms 6064 KB Output is correct
129 Correct 11 ms 6060 KB Output is correct
130 Correct 6 ms 5252 KB Output is correct
131 Correct 248 ms 5396 KB Output is correct
132 Correct 186 ms 5412 KB Output is correct
133 Correct 153 ms 5432 KB Output is correct
134 Correct 133 ms 5460 KB Output is correct
135 Correct 105 ms 5464 KB Output is correct
136 Correct 21 ms 7588 KB Output is correct
137 Correct 21 ms 7636 KB Output is correct
138 Correct 21 ms 7572 KB Output is correct
139 Correct 21 ms 7616 KB Output is correct
140 Correct 22 ms 7620 KB Output is correct
141 Correct 23 ms 7492 KB Output is correct
142 Correct 38 ms 10776 KB Output is correct
143 Correct 12 ms 6172 KB Output is correct
144 Correct 36 ms 10700 KB Output is correct
145 Correct 11 ms 6200 KB Output is correct
146 Correct 35 ms 10660 KB Output is correct
147 Correct 11 ms 6296 KB Output is correct
148 Correct 13 ms 6688 KB Output is correct
149 Correct 13 ms 6612 KB Output is correct
150 Correct 12 ms 6484 KB Output is correct
151 Correct 13 ms 6572 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 4948 KB Output is correct
2 Correct 3 ms 5004 KB Output is correct
3 Correct 3 ms 4948 KB Output is correct
4 Correct 3 ms 4948 KB Output is correct
5 Correct 3 ms 5008 KB Output is correct
6 Correct 3 ms 4948 KB Output is correct
7 Correct 3 ms 5008 KB Output is correct
8 Correct 4 ms 4948 KB Output is correct
9 Correct 4 ms 5012 KB Output is correct
10 Correct 4 ms 4948 KB Output is correct
11 Correct 3 ms 4948 KB Output is correct
12 Correct 4 ms 4948 KB Output is correct
13 Correct 3 ms 4948 KB Output is correct
14 Correct 3 ms 5008 KB Output is correct
15 Correct 4 ms 5016 KB Output is correct
16 Correct 3 ms 5076 KB Output is correct
17 Correct 4 ms 5076 KB Output is correct
18 Correct 4 ms 5016 KB Output is correct
19 Correct 4 ms 5076 KB Output is correct
20 Correct 3 ms 5016 KB Output is correct
21 Correct 4 ms 5020 KB Output is correct
22 Correct 3 ms 5076 KB Output is correct
23 Correct 4 ms 5076 KB Output is correct
24 Correct 22 ms 9868 KB Output is correct
25 Correct 21 ms 9800 KB Output is correct
26 Correct 22 ms 9864 KB Output is correct
27 Correct 5 ms 5204 KB Output is correct
28 Correct 6 ms 5204 KB Output is correct
29 Correct 6 ms 5260 KB Output is correct
30 Correct 6 ms 5204 KB Output is correct
31 Correct 6 ms 5204 KB Output is correct
32 Correct 6 ms 5204 KB Output is correct
33 Correct 10 ms 6420 KB Output is correct
34 Correct 11 ms 6484 KB Output is correct
35 Correct 10 ms 6532 KB Output is correct
36 Correct 10 ms 6476 KB Output is correct
37 Correct 11 ms 6532 KB Output is correct
38 Correct 10 ms 6508 KB Output is correct
39 Correct 28 ms 10380 KB Output is correct
40 Correct 27 ms 10312 KB Output is correct
41 Correct 30 ms 10448 KB Output is correct
42 Correct 14 ms 6324 KB Output is correct
43 Correct 11 ms 5844 KB Output is correct
44 Correct 16 ms 6356 KB Output is correct
45 Correct 11 ms 5916 KB Output is correct
46 Correct 12 ms 5892 KB Output is correct
47 Correct 14 ms 6376 KB Output is correct
48 Correct 46 ms 17144 KB Output is correct
49 Correct 30 ms 11724 KB Output is correct
50 Correct 34 ms 15140 KB Output is correct
51 Correct 41 ms 15180 KB Output is correct
52 Correct 48 ms 14764 KB Output is correct
53 Correct 40 ms 11956 KB Output is correct
54 Correct 14 ms 6480 KB Output is correct
55 Correct 13 ms 6432 KB Output is correct
56 Correct 14 ms 6380 KB Output is correct
57 Correct 14 ms 6484 KB Output is correct
58 Correct 15 ms 6428 KB Output is correct
59 Correct 14 ms 6436 KB Output is correct
60 Correct 50 ms 18112 KB Output is correct
61 Correct 52 ms 18240 KB Output is correct
62 Correct 51 ms 18124 KB Output is correct
63 Correct 53 ms 18132 KB Output is correct
64 Correct 54 ms 18192 KB Output is correct
65 Correct 55 ms 18208 KB Output is correct
66 Correct 56 ms 17176 KB Output is correct
67 Correct 64 ms 17176 KB Output is correct
68 Correct 64 ms 17180 KB Output is correct
69 Correct 3 ms 5008 KB Output is correct
70 Correct 3 ms 4948 KB Output is correct
71 Correct 4 ms 5004 KB Output is correct
72 Correct 3 ms 4948 KB Output is correct
73 Correct 3 ms 4948 KB Output is correct
74 Correct 4 ms 5016 KB Output is correct
75 Correct 3 ms 4948 KB Output is correct
76 Correct 3 ms 4948 KB Output is correct
77 Correct 3 ms 5012 KB Output is correct
78 Correct 3 ms 4976 KB Output is correct
79 Correct 3 ms 4948 KB Output is correct
80 Correct 3 ms 4948 KB Output is correct
81 Correct 3 ms 4948 KB Output is correct
82 Correct 4 ms 5004 KB Output is correct
83 Correct 3 ms 4948 KB Output is correct
84 Correct 4 ms 4948 KB Output is correct
85 Correct 4 ms 5076 KB Output is correct
86 Correct 3 ms 4948 KB Output is correct
87 Correct 4 ms 4948 KB Output is correct
88 Correct 3 ms 4948 KB Output is correct
89 Correct 3 ms 4948 KB Output is correct
90 Correct 4 ms 5016 KB Output is correct
91 Correct 3 ms 5008 KB Output is correct
92 Correct 3 ms 4948 KB Output is correct
93 Correct 3 ms 4948 KB Output is correct
94 Correct 3 ms 4948 KB Output is correct
95 Correct 4 ms 5012 KB Output is correct
96 Correct 3 ms 5076 KB Output is correct
97 Correct 3 ms 5016 KB Output is correct
98 Correct 3 ms 5076 KB Output is correct
99 Correct 3 ms 5016 KB Output is correct
100 Correct 3 ms 5076 KB Output is correct
101 Correct 5 ms 5076 KB Output is correct
102 Correct 4 ms 5076 KB Output is correct
103 Correct 4 ms 5076 KB Output is correct
104 Correct 4 ms 5016 KB Output is correct
105 Correct 4 ms 5020 KB Output is correct
106 Correct 3 ms 5076 KB Output is correct
107 Correct 4 ms 4948 KB Output is correct
108 Correct 3 ms 5044 KB Output is correct
109 Correct 5 ms 4948 KB Output is correct
110 Correct 4 ms 5008 KB Output is correct
111 Correct 4 ms 5012 KB Output is correct
112 Correct 5 ms 5276 KB Output is correct
113 Correct 5 ms 5276 KB Output is correct
114 Correct 5 ms 5204 KB Output is correct
115 Correct 4 ms 5076 KB Output is correct
116 Correct 5 ms 5212 KB Output is correct
117 Correct 5 ms 5152 KB Output is correct
118 Correct 23 ms 8680 KB Output is correct
119 Correct 20 ms 9256 KB Output is correct
120 Correct 27 ms 9776 KB Output is correct
121 Correct 6 ms 4948 KB Output is correct
122 Correct 6 ms 5008 KB Output is correct
123 Correct 5 ms 5072 KB Output is correct
124 Correct 5 ms 4948 KB Output is correct
125 Correct 6 ms 4948 KB Output is correct
126 Correct 6 ms 5404 KB Output is correct
127 Correct 6 ms 5404 KB Output is correct
128 Correct 6 ms 5360 KB Output is correct
129 Correct 6 ms 5408 KB Output is correct
130 Correct 6 ms 5460 KB Output is correct
131 Correct 5 ms 5412 KB Output is correct
132 Correct 31 ms 10240 KB Output is correct
133 Correct 29 ms 10188 KB Output is correct
134 Correct 29 ms 10268 KB Output is correct
135 Correct 6 ms 5204 KB Output is correct
136 Correct 186 ms 5400 KB Output is correct
137 Correct 102 ms 5280 KB Output is correct
138 Correct 70 ms 5276 KB Output is correct
139 Correct 63 ms 5344 KB Output is correct
140 Correct 59 ms 5332 KB Output is correct
141 Correct 15 ms 6868 KB Output is correct
142 Correct 16 ms 6712 KB Output is correct
143 Correct 20 ms 7192 KB Output is correct
144 Correct 15 ms 6868 KB Output is correct
145 Correct 17 ms 7072 KB Output is correct
146 Correct 14 ms 6628 KB Output is correct
147 Correct 22 ms 8464 KB Output is correct
148 Correct 7 ms 5716 KB Output is correct
149 Correct 24 ms 8868 KB Output is correct
150 Correct 7 ms 5588 KB Output is correct
151 Correct 27 ms 9412 KB Output is correct
152 Correct 9 ms 5972 KB Output is correct
153 Correct 10 ms 6100 KB Output is correct
154 Correct 13 ms 6376 KB Output is correct
155 Correct 9 ms 6064 KB Output is correct
156 Correct 11 ms 6060 KB Output is correct
157 Correct 6 ms 5252 KB Output is correct
158 Correct 248 ms 5396 KB Output is correct
159 Correct 186 ms 5412 KB Output is correct
160 Correct 153 ms 5432 KB Output is correct
161 Correct 133 ms 5460 KB Output is correct
162 Correct 105 ms 5464 KB Output is correct
163 Correct 21 ms 7588 KB Output is correct
164 Correct 21 ms 7636 KB Output is correct
165 Correct 21 ms 7572 KB Output is correct
166 Correct 21 ms 7616 KB Output is correct
167 Correct 22 ms 7620 KB Output is correct
168 Correct 23 ms 7492 KB Output is correct
169 Correct 38 ms 10776 KB Output is correct
170 Correct 12 ms 6172 KB Output is correct
171 Correct 36 ms 10700 KB Output is correct
172 Correct 11 ms 6200 KB Output is correct
173 Correct 35 ms 10660 KB Output is correct
174 Correct 11 ms 6296 KB Output is correct
175 Correct 13 ms 6688 KB Output is correct
176 Correct 13 ms 6612 KB Output is correct
177 Correct 12 ms 6484 KB Output is correct
178 Correct 13 ms 6572 KB Output is correct
179 Correct 13 ms 5920 KB Output is correct
180 Correct 569 ms 5812 KB Output is correct
181 Correct 604 ms 6180 KB Output is correct
182 Correct 769 ms 6604 KB Output is correct
183 Correct 375 ms 6100 KB Output is correct
184 Correct 302 ms 6052 KB Output is correct
185 Correct 35 ms 9900 KB Output is correct
186 Correct 31 ms 11640 KB Output is correct
187 Correct 40 ms 10828 KB Output is correct
188 Correct 31 ms 10208 KB Output is correct
189 Correct 54 ms 10188 KB Output is correct
190 Correct 41 ms 11540 KB Output is correct
191 Correct 39 ms 11208 KB Output is correct
192 Correct 24 ms 9348 KB Output is correct
193 Correct 28 ms 8764 KB Output is correct
194 Correct 14 ms 6376 KB Output is correct
195 Correct 1247 ms 6644 KB Output is correct
196 Correct 980 ms 6508 KB Output is correct
197 Correct 744 ms 6560 KB Output is correct
198 Correct 664 ms 6604 KB Output is correct
199 Correct 596 ms 6612 KB Output is correct
200 Correct 90 ms 18792 KB Output is correct
201 Correct 69 ms 18824 KB Output is correct
202 Correct 77 ms 18720 KB Output is correct
203 Correct 74 ms 18828 KB Output is correct
204 Correct 75 ms 18700 KB Output is correct
205 Correct 75 ms 18796 KB Output is correct
206 Correct 55 ms 17356 KB Output is correct
207 Correct 56 ms 17352 KB Output is correct
208 Correct 68 ms 17408 KB Output is correct
209 Correct 80 ms 17308 KB Output is correct
210 Correct 62 ms 17356 KB Output is correct
211 Correct 56 ms 17264 KB Output is correct
212 Correct 62 ms 18444 KB Output is correct
213 Correct 60 ms 14536 KB Output is correct
214 Correct 60 ms 14156 KB Output is correct
215 Correct 67 ms 14100 KB Output is correct