답안 #981617

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
981617 2024-05-13T11:45:37 Z yoav_s 벽 칠하기 (APIO20_paint) C++17
51 / 100
341 ms 524288 KB
#include <bits/stdc++.h>

#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("Ofast")//Comment optimisations for interactive problems (use endl)
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")

using namespace std;

typedef int ll;
typedef pair<ll,ll> p;
typedef pair<ll, p> tri;
typedef vector<ll> v;
typedef vector<v> vv;
typedef vector<p> vp;
typedef vector<tri> vtri;
typedef vector<vtri> vvtri;
typedef vector<vvtri> vvvtri;
typedef vector<vv> vvv;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<vvb> vvvb;
typedef vector<p> vp;
typedef vector<vp> vvp;
typedef vector<vvp> vvvp;
typedef vector<vvvp> vvvvp;
#define double long double
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;

const ll mod = 1e9 + 7;
const ll INF = 1e18;

#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define loop(a) for (ll i = 0; i < a; i++)
#define setmin(a, b) a = min(a, b)
#define setmax(a, b) a = max(a, b)
#define all(v) v.begin(), v.end()

#include "paint.h"
typedef bitset<50000> bs;

bool query(ll l, ll r, vector<bs> &st)
{
    ll n = st.size() / 2;
    l += n; r += n;
    bs cur;
    cur.set();
    bool first = false;
    while (l <= r)
    {
        if (l % 2 == 1)
        {
            cur &= st[l];
            l++;
        }
        if (r % 2 == 0)
        {
            cur &= st[r];
            r--;
        }
        l /= 2; r /= 2;
    }
    return cur.count() > 0;
}


int minimumInstructions(int N, int M, int K, vector<int> C, vector<int> A, vector<vector<int>> B) {
    ll n = pow(2, ceil(log2(N)));

    vector<bs> validStartIndices(2 * n);
    vv appearingIn(K);
    for (ll i = 0; i < N; i++) appearingIn[C[i]].pb(i);
    for (ll i = 0; i < M; i++)
    {
        for (ll x : B[i])
        {
            for (ll y : appearingIn[x]) validStartIndices[y + n][(i - y + M * N) % M] = 1;
        }
    }
    for (ll i = n - 1; i > 0; i--)
    {
        validStartIndices[i] = validStartIndices[2 * i] & validStartIndices[2 * i + 1];
    }
    vb poss(N - M + 1);
    for (ll i = 0; i <= N - M; i++) poss[i] = query(i, i + M - 1, validStartIndices);
    ll res = 0;
    bool possible = true;
    ll last = 0;
    ll lastDone = 0;
    while (last < N)
    {
        ll lastFound = -1;
        for (;lastDone<=min(last, N - M);lastDone++)
        {
            if (poss[lastDone]) lastFound = lastDone;
        }
        if (lastFound == -1)
        {
            possible = false;
            break;
        }
        last = lastFound + M;
        res++;
    }
    if (!possible) return -1;
    return res;
}
/*
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;
}
/**/

Compilation message

paint.cpp:3: warning: ignoring '#pragma optimization_level ' [-Wunknown-pragmas]
    3 | #pragma optimization_level 3
      | 
paint.cpp:8: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    8 | #pragma GCC optimization ("unroll-loops")
      | 
paint.cpp:140:1: warning: "/*" within comment [-Wcomment]
  140 | /**/
      |  
paint.cpp:35:16: warning: overflow in conversion from 'double' to 'll' {aka 'int'} changes value from '1.0e+18' to '2147483647' [-Woverflow]
   35 | const ll INF = 1e18;
      |                ^~~~
paint.cpp: In function 'bool query(ll, ll, std::vector<std::bitset<50000> >&)':
paint.cpp:55:10: warning: unused variable 'first' [-Wunused-variable]
   55 |     bool first = false;
      |          ^~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 4 ms 6492 KB Output is correct
8 Correct 4 ms 6492 KB Output is correct
9 Correct 3 ms 6492 KB Output is correct
10 Correct 6 ms 6492 KB Output is correct
11 Correct 4 ms 6492 KB Output is correct
12 Correct 4 ms 6492 KB Output is correct
13 Correct 4 ms 9052 KB Output is correct
14 Correct 5 ms 9052 KB Output is correct
15 Correct 6 ms 8988 KB Output is correct
16 Correct 5 ms 9048 KB Output is correct
17 Correct 5 ms 9052 KB Output is correct
18 Correct 5 ms 9052 KB Output is correct
19 Correct 5 ms 9052 KB Output is correct
20 Correct 5 ms 9052 KB Output is correct
21 Correct 5 ms 9052 KB Output is correct
22 Correct 13 ms 9756 KB Output is correct
23 Correct 13 ms 9820 KB Output is correct
24 Correct 12 ms 9724 KB Output is correct
25 Correct 287 ms 401956 KB Output is correct
26 Correct 147 ms 401956 KB Output is correct
27 Correct 154 ms 401952 KB Output is correct
28 Correct 165 ms 401920 KB Output is correct
29 Correct 168 ms 402172 KB Output is correct
30 Correct 195 ms 401744 KB Output is correct
31 Correct 250 ms 405076 KB Output is correct
32 Correct 260 ms 405028 KB Output is correct
33 Correct 247 ms 404820 KB Output is correct
34 Correct 256 ms 405032 KB Output is correct
35 Correct 248 ms 404816 KB Output is correct
36 Correct 249 ms 404820 KB Output is correct
37 Correct 263 ms 405840 KB Output is correct
38 Correct 256 ms 405624 KB Output is correct
39 Correct 261 ms 405616 KB Output is correct
40 Runtime error 108 ms 524288 KB Execution killed with signal 9
41 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 4 ms 6492 KB Output is correct
8 Correct 4 ms 6492 KB Output is correct
9 Correct 3 ms 6492 KB Output is correct
10 Correct 6 ms 6492 KB Output is correct
11 Correct 4 ms 6492 KB Output is correct
12 Correct 4 ms 6492 KB Output is correct
13 Correct 4 ms 9052 KB Output is correct
14 Correct 5 ms 9052 KB Output is correct
15 Correct 6 ms 8988 KB Output is correct
16 Correct 5 ms 9048 KB Output is correct
17 Correct 5 ms 9052 KB Output is correct
18 Correct 5 ms 9052 KB Output is correct
19 Correct 5 ms 9052 KB Output is correct
20 Correct 5 ms 9052 KB Output is correct
21 Correct 5 ms 9052 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 1 ms 596 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 3 ms 6492 KB Output is correct
28 Correct 4 ms 6492 KB Output is correct
29 Correct 3 ms 6492 KB Output is correct
30 Correct 4 ms 6492 KB Output is correct
31 Correct 5 ms 6492 KB Output is correct
32 Correct 4 ms 6492 KB Output is correct
33 Correct 4 ms 8540 KB Output is correct
34 Correct 4 ms 8184 KB Output is correct
35 Correct 4 ms 8028 KB Output is correct
36 Correct 5 ms 9204 KB Output is correct
37 Correct 4 ms 8540 KB Output is correct
38 Correct 4 ms 8796 KB Output is correct
39 Correct 3 ms 6492 KB Output is correct
40 Correct 4 ms 8284 KB Output is correct
41 Correct 3 ms 6748 KB Output is correct
42 Correct 7 ms 8792 KB Output is correct
43 Correct 4 ms 8904 KB Output is correct
44 Correct 3 ms 6500 KB Output is correct
45 Correct 4 ms 6492 KB Output is correct
46 Correct 4 ms 6492 KB Output is correct
47 Correct 4 ms 6744 KB Output is correct
48 Correct 4 ms 6492 KB Output is correct
49 Correct 5 ms 6492 KB Output is correct
50 Correct 5 ms 9052 KB Output is correct
51 Correct 7 ms 9112 KB Output is correct
52 Correct 6 ms 9052 KB Output is correct
53 Correct 5 ms 9048 KB Output is correct
54 Correct 5 ms 9052 KB Output is correct
55 Correct 5 ms 9052 KB Output is correct
56 Correct 6 ms 9080 KB Output is correct
57 Correct 4 ms 6748 KB Output is correct
58 Correct 5 ms 9052 KB Output is correct
59 Correct 6 ms 7004 KB Output is correct
60 Correct 7 ms 9116 KB Output is correct
61 Correct 4 ms 6748 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 4 ms 6492 KB Output is correct
10 Correct 4 ms 6492 KB Output is correct
11 Correct 3 ms 6492 KB Output is correct
12 Correct 6 ms 6492 KB Output is correct
13 Correct 4 ms 6492 KB Output is correct
14 Correct 4 ms 6492 KB Output is correct
15 Correct 4 ms 9052 KB Output is correct
16 Correct 5 ms 9052 KB Output is correct
17 Correct 6 ms 8988 KB Output is correct
18 Correct 5 ms 9048 KB Output is correct
19 Correct 5 ms 9052 KB Output is correct
20 Correct 5 ms 9052 KB Output is correct
21 Correct 5 ms 9052 KB Output is correct
22 Correct 5 ms 9052 KB Output is correct
23 Correct 5 ms 9052 KB Output is correct
24 Correct 13 ms 9756 KB Output is correct
25 Correct 13 ms 9820 KB Output is correct
26 Correct 12 ms 9724 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 1 ms 596 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 3 ms 6492 KB Output is correct
31 Correct 4 ms 6492 KB Output is correct
32 Correct 3 ms 6492 KB Output is correct
33 Correct 4 ms 6492 KB Output is correct
34 Correct 5 ms 6492 KB Output is correct
35 Correct 4 ms 6492 KB Output is correct
36 Correct 4 ms 8540 KB Output is correct
37 Correct 4 ms 8184 KB Output is correct
38 Correct 4 ms 8028 KB Output is correct
39 Correct 5 ms 9204 KB Output is correct
40 Correct 4 ms 8540 KB Output is correct
41 Correct 4 ms 8796 KB Output is correct
42 Correct 3 ms 6492 KB Output is correct
43 Correct 4 ms 8284 KB Output is correct
44 Correct 3 ms 6748 KB Output is correct
45 Correct 7 ms 8792 KB Output is correct
46 Correct 4 ms 8904 KB Output is correct
47 Correct 3 ms 6500 KB Output is correct
48 Correct 4 ms 6492 KB Output is correct
49 Correct 4 ms 6492 KB Output is correct
50 Correct 4 ms 6744 KB Output is correct
51 Correct 4 ms 6492 KB Output is correct
52 Correct 5 ms 6492 KB Output is correct
53 Correct 5 ms 9052 KB Output is correct
54 Correct 7 ms 9112 KB Output is correct
55 Correct 6 ms 9052 KB Output is correct
56 Correct 5 ms 9048 KB Output is correct
57 Correct 5 ms 9052 KB Output is correct
58 Correct 5 ms 9052 KB Output is correct
59 Correct 6 ms 9080 KB Output is correct
60 Correct 4 ms 6748 KB Output is correct
61 Correct 5 ms 9052 KB Output is correct
62 Correct 6 ms 7004 KB Output is correct
63 Correct 7 ms 9116 KB Output is correct
64 Correct 4 ms 6748 KB Output is correct
65 Correct 2 ms 3416 KB Output is correct
66 Correct 4 ms 6488 KB Output is correct
67 Correct 4 ms 6708 KB Output is correct
68 Correct 5 ms 6492 KB Output is correct
69 Correct 4 ms 6492 KB Output is correct
70 Correct 5 ms 8796 KB Output is correct
71 Correct 5 ms 8284 KB Output is correct
72 Correct 5 ms 8028 KB Output is correct
73 Correct 4 ms 8284 KB Output is correct
74 Correct 5 ms 8696 KB Output is correct
75 Correct 5 ms 9052 KB Output is correct
76 Correct 12 ms 9052 KB Output is correct
77 Correct 14 ms 9564 KB Output is correct
78 Correct 17 ms 10076 KB Output is correct
79 Correct 5 ms 6748 KB Output is correct
80 Correct 5 ms 6748 KB Output is correct
81 Correct 4 ms 6748 KB Output is correct
82 Correct 6 ms 6748 KB Output is correct
83 Correct 5 ms 6748 KB Output is correct
84 Correct 6 ms 9048 KB Output is correct
85 Correct 6 ms 9048 KB Output is correct
86 Correct 6 ms 9052 KB Output is correct
87 Correct 6 ms 9052 KB Output is correct
88 Correct 6 ms 9052 KB Output is correct
89 Correct 6 ms 9052 KB Output is correct
90 Correct 17 ms 10232 KB Output is correct
91 Correct 17 ms 10072 KB Output is correct
92 Correct 17 ms 10072 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 4 ms 6492 KB Output is correct
10 Correct 4 ms 6492 KB Output is correct
11 Correct 3 ms 6492 KB Output is correct
12 Correct 6 ms 6492 KB Output is correct
13 Correct 4 ms 6492 KB Output is correct
14 Correct 4 ms 6492 KB Output is correct
15 Correct 4 ms 9052 KB Output is correct
16 Correct 5 ms 9052 KB Output is correct
17 Correct 6 ms 8988 KB Output is correct
18 Correct 5 ms 9048 KB Output is correct
19 Correct 5 ms 9052 KB Output is correct
20 Correct 5 ms 9052 KB Output is correct
21 Correct 5 ms 9052 KB Output is correct
22 Correct 5 ms 9052 KB Output is correct
23 Correct 5 ms 9052 KB Output is correct
24 Correct 13 ms 9756 KB Output is correct
25 Correct 13 ms 9820 KB Output is correct
26 Correct 12 ms 9724 KB Output is correct
27 Correct 287 ms 401956 KB Output is correct
28 Correct 147 ms 401956 KB Output is correct
29 Correct 154 ms 401952 KB Output is correct
30 Correct 165 ms 401920 KB Output is correct
31 Correct 168 ms 402172 KB Output is correct
32 Correct 195 ms 401744 KB Output is correct
33 Correct 250 ms 405076 KB Output is correct
34 Correct 260 ms 405028 KB Output is correct
35 Correct 247 ms 404820 KB Output is correct
36 Correct 256 ms 405032 KB Output is correct
37 Correct 248 ms 404816 KB Output is correct
38 Correct 249 ms 404820 KB Output is correct
39 Correct 263 ms 405840 KB Output is correct
40 Correct 256 ms 405624 KB Output is correct
41 Correct 261 ms 405616 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 1 ms 596 KB Output is correct
44 Correct 0 ms 348 KB Output is correct
45 Correct 3 ms 6492 KB Output is correct
46 Correct 4 ms 6492 KB Output is correct
47 Correct 3 ms 6492 KB Output is correct
48 Correct 4 ms 6492 KB Output is correct
49 Correct 5 ms 6492 KB Output is correct
50 Correct 4 ms 6492 KB Output is correct
51 Correct 4 ms 8540 KB Output is correct
52 Correct 4 ms 8184 KB Output is correct
53 Correct 4 ms 8028 KB Output is correct
54 Correct 5 ms 9204 KB Output is correct
55 Correct 4 ms 8540 KB Output is correct
56 Correct 4 ms 8796 KB Output is correct
57 Correct 3 ms 6492 KB Output is correct
58 Correct 4 ms 8284 KB Output is correct
59 Correct 3 ms 6748 KB Output is correct
60 Correct 7 ms 8792 KB Output is correct
61 Correct 4 ms 8904 KB Output is correct
62 Correct 3 ms 6500 KB Output is correct
63 Correct 4 ms 6492 KB Output is correct
64 Correct 4 ms 6492 KB Output is correct
65 Correct 4 ms 6744 KB Output is correct
66 Correct 4 ms 6492 KB Output is correct
67 Correct 5 ms 6492 KB Output is correct
68 Correct 5 ms 9052 KB Output is correct
69 Correct 7 ms 9112 KB Output is correct
70 Correct 6 ms 9052 KB Output is correct
71 Correct 5 ms 9048 KB Output is correct
72 Correct 5 ms 9052 KB Output is correct
73 Correct 5 ms 9052 KB Output is correct
74 Correct 6 ms 9080 KB Output is correct
75 Correct 4 ms 6748 KB Output is correct
76 Correct 5 ms 9052 KB Output is correct
77 Correct 6 ms 7004 KB Output is correct
78 Correct 7 ms 9116 KB Output is correct
79 Correct 4 ms 6748 KB Output is correct
80 Correct 2 ms 3416 KB Output is correct
81 Correct 4 ms 6488 KB Output is correct
82 Correct 4 ms 6708 KB Output is correct
83 Correct 5 ms 6492 KB Output is correct
84 Correct 4 ms 6492 KB Output is correct
85 Correct 5 ms 8796 KB Output is correct
86 Correct 5 ms 8284 KB Output is correct
87 Correct 5 ms 8028 KB Output is correct
88 Correct 4 ms 8284 KB Output is correct
89 Correct 5 ms 8696 KB Output is correct
90 Correct 5 ms 9052 KB Output is correct
91 Correct 12 ms 9052 KB Output is correct
92 Correct 14 ms 9564 KB Output is correct
93 Correct 17 ms 10076 KB Output is correct
94 Correct 5 ms 6748 KB Output is correct
95 Correct 5 ms 6748 KB Output is correct
96 Correct 4 ms 6748 KB Output is correct
97 Correct 6 ms 6748 KB Output is correct
98 Correct 5 ms 6748 KB Output is correct
99 Correct 6 ms 9048 KB Output is correct
100 Correct 6 ms 9048 KB Output is correct
101 Correct 6 ms 9052 KB Output is correct
102 Correct 6 ms 9052 KB Output is correct
103 Correct 6 ms 9052 KB Output is correct
104 Correct 6 ms 9052 KB Output is correct
105 Correct 17 ms 10232 KB Output is correct
106 Correct 17 ms 10072 KB Output is correct
107 Correct 17 ms 10072 KB Output is correct
108 Correct 166 ms 401740 KB Output is correct
109 Correct 226 ms 201296 KB Output is correct
110 Correct 181 ms 201552 KB Output is correct
111 Correct 158 ms 201232 KB Output is correct
112 Correct 205 ms 201296 KB Output is correct
113 Correct 155 ms 201296 KB Output is correct
114 Correct 133 ms 204056 KB Output is correct
115 Correct 112 ms 203868 KB Output is correct
116 Correct 236 ms 405076 KB Output is correct
117 Correct 138 ms 203640 KB Output is correct
118 Correct 132 ms 204112 KB Output is correct
119 Correct 158 ms 204280 KB Output is correct
120 Correct 140 ms 203756 KB Output is correct
121 Correct 132 ms 201860 KB Output is correct
122 Correct 137 ms 203736 KB Output is correct
123 Correct 130 ms 201748 KB Output is correct
124 Correct 245 ms 405120 KB Output is correct
125 Correct 213 ms 402512 KB Output is correct
126 Correct 123 ms 203092 KB Output is correct
127 Correct 235 ms 404744 KB Output is correct
128 Correct 131 ms 203344 KB Output is correct
129 Correct 139 ms 202792 KB Output is correct
130 Correct 157 ms 401900 KB Output is correct
131 Correct 341 ms 402092 KB Output is correct
132 Correct 319 ms 402008 KB Output is correct
133 Correct 307 ms 402000 KB Output is correct
134 Correct 315 ms 402200 KB Output is correct
135 Correct 299 ms 401996 KB Output is correct
136 Correct 258 ms 405536 KB Output is correct
137 Correct 265 ms 405584 KB Output is correct
138 Correct 260 ms 405332 KB Output is correct
139 Correct 262 ms 405584 KB Output is correct
140 Correct 257 ms 405328 KB Output is correct
141 Correct 269 ms 405400 KB Output is correct
142 Correct 261 ms 406056 KB Output is correct
143 Correct 247 ms 402928 KB Output is correct
144 Correct 261 ms 406116 KB Output is correct
145 Correct 248 ms 402768 KB Output is correct
146 Correct 265 ms 405840 KB Output is correct
147 Correct 253 ms 402972 KB Output is correct
148 Correct 249 ms 405076 KB Output is correct
149 Correct 267 ms 404868 KB Output is correct
150 Correct 245 ms 405004 KB Output is correct
151 Correct 241 ms 404820 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 4 ms 6492 KB Output is correct
10 Correct 4 ms 6492 KB Output is correct
11 Correct 3 ms 6492 KB Output is correct
12 Correct 6 ms 6492 KB Output is correct
13 Correct 4 ms 6492 KB Output is correct
14 Correct 4 ms 6492 KB Output is correct
15 Correct 4 ms 9052 KB Output is correct
16 Correct 5 ms 9052 KB Output is correct
17 Correct 6 ms 8988 KB Output is correct
18 Correct 5 ms 9048 KB Output is correct
19 Correct 5 ms 9052 KB Output is correct
20 Correct 5 ms 9052 KB Output is correct
21 Correct 5 ms 9052 KB Output is correct
22 Correct 5 ms 9052 KB Output is correct
23 Correct 5 ms 9052 KB Output is correct
24 Correct 13 ms 9756 KB Output is correct
25 Correct 13 ms 9820 KB Output is correct
26 Correct 12 ms 9724 KB Output is correct
27 Correct 287 ms 401956 KB Output is correct
28 Correct 147 ms 401956 KB Output is correct
29 Correct 154 ms 401952 KB Output is correct
30 Correct 165 ms 401920 KB Output is correct
31 Correct 168 ms 402172 KB Output is correct
32 Correct 195 ms 401744 KB Output is correct
33 Correct 250 ms 405076 KB Output is correct
34 Correct 260 ms 405028 KB Output is correct
35 Correct 247 ms 404820 KB Output is correct
36 Correct 256 ms 405032 KB Output is correct
37 Correct 248 ms 404816 KB Output is correct
38 Correct 249 ms 404820 KB Output is correct
39 Correct 263 ms 405840 KB Output is correct
40 Correct 256 ms 405624 KB Output is correct
41 Correct 261 ms 405616 KB Output is correct
42 Runtime error 108 ms 524288 KB Execution killed with signal 9
43 Halted 0 ms 0 KB -