#include "paint.h"
#include <cstring>
#include <algorithm>
#include <cstdlib>
#include <cassert>
#include <cstdio>
#define NMAX 200010
#define KMAX 110
using namespace std;
int pr[NMAX];
int nx[NMAX];
int dp1[NMAX][KMAX];
int dp2[NMAX][KMAX];
string S;
int N,K;
int A[NMAX];
int fst,lst;
int wht[NMAX];
int blk[NMAX];
void init(){
int i,p;
p = -1;
for(i = 0; i < N; ++i){
pr[i] = p;
if(S[i] == '_') p=i;
}
p = N;
for(i = N-1; i >=0 ; --i){
nx[i] = p;
if(S[i] == '_') p =i;
}
for(i = 0; i < N;++i) if(S[i] == 'X') break;
fst =(i < N ? i : 100);
for(i = N-1; i >= 0; --i) if(S[i] == 'X') break;
lst =(i >= 0 ? i : -100);
}
inline int getdp1(int i, int k){
if(i < 0 && k >= 0) return 0;
if(i < 0) return 1;
if(k < 0) return fst > i;
return dp1[i][k];
}
inline int getdp2(int i, int k){
if(i >= N && k < K) return 0;
if(i >= N) return 1;
if(k >= K) return lst < i;
return dp2[i][k];
}
int st[NMAX][KMAX];
void dodp(){
int i,k;
for(i = 0; i < N; ++i){
for(k =0 ; k < K; ++k){
dp1[i][k]=0;
if(S[i] != 'X') dp1[i][k] |= getdp1(i-1,k);
if(S[i] == '_' || i-A[k]+1 < 0 || pr[i] > i-A[k]) continue;
if(i-A[k] >= 0 && S[i-A[k]] == 'X') continue;
dp1[i][k] |= getdp1(i-A[k]-1,k-1);
}
}
for(i = N-1; i >= 0; --i){
for(k = K-1;k >= 0; --k){
dp2[i][k]=0;
if(S[i] != 'X') dp2[i][k] |= getdp2(i+1,k);
if(S[i] == '_' || i+A[k] > N || nx[i] < i+A[k]) continue;
if(i+A[k] < N && S[i+A[k]]=='X') continue;
if(!getdp2(i+A[k]+1,k+1)) continue;
dp2[i][k]=1;
st[i][k]=1;
}
}
}
int mx;
inline int check_white(int i){
if(S[i] == 'X') return 0;
int k;
for(k =0 ; k <= K; ++k) if(getdp1(i-1,k-1) && getdp2(i+1,k)) return 1;
return 0;
}
inline int check_black(int i){
if(S[i] == '_') return 0;
int b = (i <= mx);
int k;
if(S[i-1] == 'X') return b;
for(k =0; k < K; ++k){
if(!getdp1(i-2,k-1) || !st[i][k]) continue;
b = 1;
mx = max(mx,i+A[k]-1);
}
return b;
}
string sol;
std::string solve_puzzle(std::string s, std::vector<int> c) {
N= s.size();
K=c.size();
int i;
S = s;
for(i =0 ; i < K; ++i) A[i]=c[i];
mx=-1;
init();
dodp();
for(i = 0; i < N; ++i){
wht[i] = check_white(i);
blk[i] = check_black(i);
}
for(i = 0; i < N; ++i){
if(wht[i] && blk[i]){
sol.push_back('?');
continue;
}
sol.push_back(blk[i] ? 'X' : '_');
}
return sol;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
263860 KB |
n = 13, m = 1 |
2 |
Correct |
0 ms |
263860 KB |
n = 18, m = 1 |
3 |
Correct |
0 ms |
263860 KB |
n = 17, m = 1 |
4 |
Correct |
0 ms |
263860 KB |
n = 1, m = 1 |
5 |
Correct |
0 ms |
263860 KB |
n = 20, m = 1 |
6 |
Correct |
0 ms |
263860 KB |
n = 20, m = 1 |
7 |
Correct |
0 ms |
263860 KB |
n = 20, m = 1 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
263860 KB |
n = 13, m = 1 |
2 |
Correct |
0 ms |
263860 KB |
n = 18, m = 1 |
3 |
Correct |
0 ms |
263860 KB |
n = 17, m = 1 |
4 |
Correct |
0 ms |
263860 KB |
n = 1, m = 1 |
5 |
Correct |
0 ms |
263860 KB |
n = 20, m = 1 |
6 |
Correct |
0 ms |
263860 KB |
n = 20, m = 1 |
7 |
Correct |
0 ms |
263860 KB |
n = 20, m = 1 |
8 |
Correct |
0 ms |
263860 KB |
n = 20, m = 5 |
9 |
Correct |
0 ms |
263860 KB |
n = 18, m = 3 |
10 |
Correct |
0 ms |
263860 KB |
n = 17, m = 2 |
11 |
Correct |
0 ms |
263860 KB |
n = 20, m = 2 |
12 |
Correct |
0 ms |
263860 KB |
n = 17, m = 4 |
13 |
Correct |
0 ms |
263860 KB |
n = 17, m = 6 |
14 |
Correct |
0 ms |
263860 KB |
n = 17, m = 1 |
15 |
Correct |
0 ms |
263860 KB |
n = 17, m = 4 |
16 |
Correct |
0 ms |
263860 KB |
n = 13, m = 3 |
17 |
Correct |
0 ms |
263860 KB |
n = 18, m = 4 |
18 |
Correct |
0 ms |
263860 KB |
n = 20, m = 10 |
19 |
Correct |
0 ms |
263860 KB |
n = 19, m = 10 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
263860 KB |
n = 13, m = 1 |
2 |
Correct |
0 ms |
263860 KB |
n = 18, m = 1 |
3 |
Correct |
0 ms |
263860 KB |
n = 17, m = 1 |
4 |
Correct |
0 ms |
263860 KB |
n = 1, m = 1 |
5 |
Correct |
0 ms |
263860 KB |
n = 20, m = 1 |
6 |
Correct |
0 ms |
263860 KB |
n = 20, m = 1 |
7 |
Correct |
0 ms |
263860 KB |
n = 20, m = 1 |
8 |
Correct |
0 ms |
263860 KB |
n = 20, m = 5 |
9 |
Correct |
0 ms |
263860 KB |
n = 18, m = 3 |
10 |
Correct |
0 ms |
263860 KB |
n = 17, m = 2 |
11 |
Correct |
0 ms |
263860 KB |
n = 20, m = 2 |
12 |
Correct |
0 ms |
263860 KB |
n = 17, m = 4 |
13 |
Correct |
0 ms |
263860 KB |
n = 17, m = 6 |
14 |
Correct |
0 ms |
263860 KB |
n = 17, m = 1 |
15 |
Correct |
0 ms |
263860 KB |
n = 17, m = 4 |
16 |
Correct |
0 ms |
263860 KB |
n = 13, m = 3 |
17 |
Correct |
0 ms |
263860 KB |
n = 18, m = 4 |
18 |
Correct |
0 ms |
263860 KB |
n = 20, m = 10 |
19 |
Correct |
0 ms |
263860 KB |
n = 19, m = 10 |
20 |
Correct |
0 ms |
263860 KB |
n = 100, m = 5 |
21 |
Correct |
0 ms |
263860 KB |
n = 90, m = 3 |
22 |
Correct |
0 ms |
263860 KB |
n = 86, m = 2 |
23 |
Correct |
0 ms |
263860 KB |
n = 81, m = 4 |
24 |
Correct |
0 ms |
263860 KB |
n = 89, m = 10 |
25 |
Correct |
0 ms |
263860 KB |
n = 81, m = 23 |
26 |
Correct |
0 ms |
263860 KB |
n = 86, m = 8 |
27 |
Correct |
0 ms |
263860 KB |
n = 53, m = 22 |
28 |
Correct |
0 ms |
263860 KB |
n = 89, m = 35 |
29 |
Correct |
0 ms |
263860 KB |
n = 63, m = 25 |
30 |
Correct |
0 ms |
263860 KB |
n = 100, m = 50 |
31 |
Correct |
0 ms |
263860 KB |
n = 99, m = 50 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
263860 KB |
n = 13, m = 1 |
2 |
Correct |
0 ms |
263860 KB |
n = 18, m = 1 |
3 |
Correct |
0 ms |
263860 KB |
n = 17, m = 1 |
4 |
Correct |
0 ms |
263860 KB |
n = 1, m = 1 |
5 |
Correct |
0 ms |
263860 KB |
n = 20, m = 1 |
6 |
Correct |
0 ms |
263860 KB |
n = 20, m = 1 |
7 |
Correct |
0 ms |
263860 KB |
n = 20, m = 1 |
8 |
Correct |
0 ms |
263860 KB |
n = 20, m = 5 |
9 |
Correct |
0 ms |
263860 KB |
n = 18, m = 3 |
10 |
Correct |
0 ms |
263860 KB |
n = 17, m = 2 |
11 |
Correct |
0 ms |
263860 KB |
n = 20, m = 2 |
12 |
Correct |
0 ms |
263860 KB |
n = 17, m = 4 |
13 |
Correct |
0 ms |
263860 KB |
n = 17, m = 6 |
14 |
Correct |
0 ms |
263860 KB |
n = 17, m = 1 |
15 |
Correct |
0 ms |
263860 KB |
n = 17, m = 4 |
16 |
Correct |
0 ms |
263860 KB |
n = 13, m = 3 |
17 |
Correct |
0 ms |
263860 KB |
n = 18, m = 4 |
18 |
Correct |
0 ms |
263860 KB |
n = 20, m = 10 |
19 |
Correct |
0 ms |
263860 KB |
n = 19, m = 10 |
20 |
Correct |
0 ms |
263860 KB |
n = 100, m = 5 |
21 |
Correct |
0 ms |
263860 KB |
n = 90, m = 3 |
22 |
Correct |
0 ms |
263860 KB |
n = 86, m = 2 |
23 |
Correct |
0 ms |
263860 KB |
n = 81, m = 4 |
24 |
Correct |
0 ms |
263860 KB |
n = 89, m = 10 |
25 |
Correct |
0 ms |
263860 KB |
n = 81, m = 23 |
26 |
Correct |
0 ms |
263860 KB |
n = 86, m = 8 |
27 |
Correct |
0 ms |
263860 KB |
n = 53, m = 22 |
28 |
Correct |
0 ms |
263860 KB |
n = 89, m = 35 |
29 |
Correct |
0 ms |
263860 KB |
n = 63, m = 25 |
30 |
Correct |
0 ms |
263860 KB |
n = 100, m = 50 |
31 |
Correct |
0 ms |
263860 KB |
n = 99, m = 50 |
32 |
Correct |
0 ms |
263860 KB |
n = 13, m = 4 |
33 |
Correct |
0 ms |
263860 KB |
n = 86, m = 2 |
34 |
Correct |
0 ms |
263860 KB |
n = 88, m = 2 |
35 |
Correct |
0 ms |
263860 KB |
n = 86, m = 2 |
36 |
Correct |
0 ms |
263860 KB |
n = 81, m = 6 |
37 |
Correct |
0 ms |
263860 KB |
n = 98, m = 7 |
38 |
Correct |
0 ms |
263860 KB |
n = 92, m = 7 |
39 |
Correct |
0 ms |
263860 KB |
n = 88, m = 21 |
40 |
Correct |
0 ms |
263860 KB |
n = 90, m = 21 |
41 |
Correct |
0 ms |
263860 KB |
n = 98, m = 22 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
263860 KB |
n = 13, m = 1 |
2 |
Correct |
0 ms |
263860 KB |
n = 18, m = 1 |
3 |
Correct |
0 ms |
263860 KB |
n = 17, m = 1 |
4 |
Correct |
0 ms |
263860 KB |
n = 1, m = 1 |
5 |
Correct |
0 ms |
263860 KB |
n = 20, m = 1 |
6 |
Correct |
0 ms |
263860 KB |
n = 20, m = 1 |
7 |
Correct |
0 ms |
263860 KB |
n = 20, m = 1 |
8 |
Correct |
0 ms |
263860 KB |
n = 20, m = 5 |
9 |
Correct |
0 ms |
263860 KB |
n = 18, m = 3 |
10 |
Correct |
0 ms |
263860 KB |
n = 17, m = 2 |
11 |
Correct |
0 ms |
263860 KB |
n = 20, m = 2 |
12 |
Correct |
0 ms |
263860 KB |
n = 17, m = 4 |
13 |
Correct |
0 ms |
263860 KB |
n = 17, m = 6 |
14 |
Correct |
0 ms |
263860 KB |
n = 17, m = 1 |
15 |
Correct |
0 ms |
263860 KB |
n = 17, m = 4 |
16 |
Correct |
0 ms |
263860 KB |
n = 13, m = 3 |
17 |
Correct |
0 ms |
263860 KB |
n = 18, m = 4 |
18 |
Correct |
0 ms |
263860 KB |
n = 20, m = 10 |
19 |
Correct |
0 ms |
263860 KB |
n = 19, m = 10 |
20 |
Correct |
0 ms |
263860 KB |
n = 100, m = 5 |
21 |
Correct |
0 ms |
263860 KB |
n = 90, m = 3 |
22 |
Correct |
0 ms |
263860 KB |
n = 86, m = 2 |
23 |
Correct |
0 ms |
263860 KB |
n = 81, m = 4 |
24 |
Correct |
0 ms |
263860 KB |
n = 89, m = 10 |
25 |
Correct |
0 ms |
263860 KB |
n = 81, m = 23 |
26 |
Correct |
0 ms |
263860 KB |
n = 86, m = 8 |
27 |
Correct |
0 ms |
263860 KB |
n = 53, m = 22 |
28 |
Correct |
0 ms |
263860 KB |
n = 89, m = 35 |
29 |
Correct |
0 ms |
263860 KB |
n = 63, m = 25 |
30 |
Correct |
0 ms |
263860 KB |
n = 100, m = 50 |
31 |
Correct |
0 ms |
263860 KB |
n = 99, m = 50 |
32 |
Correct |
0 ms |
263860 KB |
n = 13, m = 4 |
33 |
Correct |
0 ms |
263860 KB |
n = 86, m = 2 |
34 |
Correct |
0 ms |
263860 KB |
n = 88, m = 2 |
35 |
Correct |
0 ms |
263860 KB |
n = 86, m = 2 |
36 |
Correct |
0 ms |
263860 KB |
n = 81, m = 6 |
37 |
Correct |
0 ms |
263860 KB |
n = 98, m = 7 |
38 |
Correct |
0 ms |
263860 KB |
n = 92, m = 7 |
39 |
Correct |
0 ms |
263860 KB |
n = 88, m = 21 |
40 |
Correct |
0 ms |
263860 KB |
n = 90, m = 21 |
41 |
Correct |
0 ms |
263860 KB |
n = 98, m = 22 |
42 |
Correct |
0 ms |
263860 KB |
n = 11, m = 2 |
43 |
Correct |
0 ms |
263860 KB |
n = 11, m = 2 |
44 |
Correct |
0 ms |
263860 KB |
n = 13, m = 3 |
45 |
Correct |
0 ms |
263860 KB |
n = 86, m = 2 |
46 |
Correct |
0 ms |
263860 KB |
n = 81, m = 2 |
47 |
Correct |
0 ms |
263860 KB |
n = 93, m = 2 |
48 |
Correct |
0 ms |
263860 KB |
n = 81, m = 2 |
49 |
Correct |
0 ms |
263860 KB |
n = 86, m = 2 |
50 |
Correct |
0 ms |
263860 KB |
n = 90, m = 2 |
51 |
Correct |
0 ms |
263860 KB |
n = 87, m = 2 |
52 |
Correct |
0 ms |
263860 KB |
n = 97, m = 2 |
53 |
Correct |
0 ms |
263860 KB |
n = 85, m = 2 |
54 |
Correct |
0 ms |
263860 KB |
n = 88, m = 7 |
55 |
Correct |
0 ms |
263860 KB |
n = 96, m = 7 |
56 |
Correct |
0 ms |
263860 KB |
n = 85, m = 7 |
57 |
Correct |
0 ms |
263860 KB |
n = 92, m = 7 |
58 |
Correct |
0 ms |
263860 KB |
n = 92, m = 7 |
59 |
Correct |
0 ms |
263860 KB |
n = 86, m = 7 |
60 |
Correct |
0 ms |
263860 KB |
n = 87, m = 7 |
61 |
Correct |
0 ms |
263860 KB |
n = 100, m = 7 |
62 |
Correct |
0 ms |
263860 KB |
n = 100, m = 7 |
63 |
Correct |
0 ms |
263860 KB |
n = 92, m = 21 |
64 |
Correct |
0 ms |
263860 KB |
n = 93, m = 22 |
65 |
Correct |
0 ms |
263860 KB |
n = 95, m = 22 |
66 |
Correct |
0 ms |
263860 KB |
n = 98, m = 22 |
67 |
Correct |
0 ms |
263860 KB |
n = 94, m = 22 |
68 |
Correct |
0 ms |
263860 KB |
n = 93, m = 22 |
69 |
Correct |
0 ms |
263860 KB |
n = 88, m = 21 |
70 |
Correct |
0 ms |
263860 KB |
n = 83, m = 20 |
71 |
Correct |
0 ms |
263860 KB |
n = 99, m = 23 |
72 |
Correct |
0 ms |
263860 KB |
n = 96, m = 19 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
263860 KB |
n = 13, m = 1 |
2 |
Correct |
0 ms |
263860 KB |
n = 18, m = 1 |
3 |
Correct |
0 ms |
263860 KB |
n = 17, m = 1 |
4 |
Correct |
0 ms |
263860 KB |
n = 1, m = 1 |
5 |
Correct |
0 ms |
263860 KB |
n = 20, m = 1 |
6 |
Correct |
0 ms |
263860 KB |
n = 20, m = 1 |
7 |
Correct |
0 ms |
263860 KB |
n = 20, m = 1 |
8 |
Correct |
0 ms |
263860 KB |
n = 20, m = 5 |
9 |
Correct |
0 ms |
263860 KB |
n = 18, m = 3 |
10 |
Correct |
0 ms |
263860 KB |
n = 17, m = 2 |
11 |
Correct |
0 ms |
263860 KB |
n = 20, m = 2 |
12 |
Correct |
0 ms |
263860 KB |
n = 17, m = 4 |
13 |
Correct |
0 ms |
263860 KB |
n = 17, m = 6 |
14 |
Correct |
0 ms |
263860 KB |
n = 17, m = 1 |
15 |
Correct |
0 ms |
263860 KB |
n = 17, m = 4 |
16 |
Correct |
0 ms |
263860 KB |
n = 13, m = 3 |
17 |
Correct |
0 ms |
263860 KB |
n = 18, m = 4 |
18 |
Correct |
0 ms |
263860 KB |
n = 20, m = 10 |
19 |
Correct |
0 ms |
263860 KB |
n = 19, m = 10 |
20 |
Correct |
0 ms |
263860 KB |
n = 100, m = 5 |
21 |
Correct |
0 ms |
263860 KB |
n = 90, m = 3 |
22 |
Correct |
0 ms |
263860 KB |
n = 86, m = 2 |
23 |
Correct |
0 ms |
263860 KB |
n = 81, m = 4 |
24 |
Correct |
0 ms |
263860 KB |
n = 89, m = 10 |
25 |
Correct |
0 ms |
263860 KB |
n = 81, m = 23 |
26 |
Correct |
0 ms |
263860 KB |
n = 86, m = 8 |
27 |
Correct |
0 ms |
263860 KB |
n = 53, m = 22 |
28 |
Correct |
0 ms |
263860 KB |
n = 89, m = 35 |
29 |
Correct |
0 ms |
263860 KB |
n = 63, m = 25 |
30 |
Correct |
0 ms |
263860 KB |
n = 100, m = 50 |
31 |
Correct |
0 ms |
263860 KB |
n = 99, m = 50 |
32 |
Correct |
0 ms |
263860 KB |
n = 13, m = 4 |
33 |
Correct |
0 ms |
263860 KB |
n = 86, m = 2 |
34 |
Correct |
0 ms |
263860 KB |
n = 88, m = 2 |
35 |
Correct |
0 ms |
263860 KB |
n = 86, m = 2 |
36 |
Correct |
0 ms |
263860 KB |
n = 81, m = 6 |
37 |
Correct |
0 ms |
263860 KB |
n = 98, m = 7 |
38 |
Correct |
0 ms |
263860 KB |
n = 92, m = 7 |
39 |
Correct |
0 ms |
263860 KB |
n = 88, m = 21 |
40 |
Correct |
0 ms |
263860 KB |
n = 90, m = 21 |
41 |
Correct |
0 ms |
263860 KB |
n = 98, m = 22 |
42 |
Correct |
0 ms |
263860 KB |
n = 11, m = 2 |
43 |
Correct |
0 ms |
263860 KB |
n = 11, m = 2 |
44 |
Correct |
0 ms |
263860 KB |
n = 13, m = 3 |
45 |
Correct |
0 ms |
263860 KB |
n = 86, m = 2 |
46 |
Correct |
0 ms |
263860 KB |
n = 81, m = 2 |
47 |
Correct |
0 ms |
263860 KB |
n = 93, m = 2 |
48 |
Correct |
0 ms |
263860 KB |
n = 81, m = 2 |
49 |
Correct |
0 ms |
263860 KB |
n = 86, m = 2 |
50 |
Correct |
0 ms |
263860 KB |
n = 90, m = 2 |
51 |
Correct |
0 ms |
263860 KB |
n = 87, m = 2 |
52 |
Correct |
0 ms |
263860 KB |
n = 97, m = 2 |
53 |
Correct |
0 ms |
263860 KB |
n = 85, m = 2 |
54 |
Correct |
0 ms |
263860 KB |
n = 88, m = 7 |
55 |
Correct |
0 ms |
263860 KB |
n = 96, m = 7 |
56 |
Correct |
0 ms |
263860 KB |
n = 85, m = 7 |
57 |
Correct |
0 ms |
263860 KB |
n = 92, m = 7 |
58 |
Correct |
0 ms |
263860 KB |
n = 92, m = 7 |
59 |
Correct |
0 ms |
263860 KB |
n = 86, m = 7 |
60 |
Correct |
0 ms |
263860 KB |
n = 87, m = 7 |
61 |
Correct |
0 ms |
263860 KB |
n = 100, m = 7 |
62 |
Correct |
0 ms |
263860 KB |
n = 100, m = 7 |
63 |
Correct |
0 ms |
263860 KB |
n = 92, m = 21 |
64 |
Correct |
0 ms |
263860 KB |
n = 93, m = 22 |
65 |
Correct |
0 ms |
263860 KB |
n = 95, m = 22 |
66 |
Correct |
0 ms |
263860 KB |
n = 98, m = 22 |
67 |
Correct |
0 ms |
263860 KB |
n = 94, m = 22 |
68 |
Correct |
0 ms |
263860 KB |
n = 93, m = 22 |
69 |
Correct |
0 ms |
263860 KB |
n = 88, m = 21 |
70 |
Correct |
0 ms |
263860 KB |
n = 83, m = 20 |
71 |
Correct |
0 ms |
263860 KB |
n = 99, m = 23 |
72 |
Correct |
0 ms |
263860 KB |
n = 96, m = 19 |
73 |
Correct |
0 ms |
263860 KB |
n = 4825, m = 5 |
74 |
Correct |
0 ms |
263860 KB |
n = 4384, m = 5 |
75 |
Correct |
0 ms |
263860 KB |
n = 4528, m = 5 |
76 |
Correct |
3 ms |
263860 KB |
n = 4980, m = 5 |
77 |
Correct |
0 ms |
263860 KB |
n = 4730, m = 5 |
78 |
Correct |
0 ms |
263860 KB |
n = 4784, m = 5 |
79 |
Correct |
0 ms |
263860 KB |
n = 4875, m = 5 |
80 |
Correct |
0 ms |
263860 KB |
n = 4576, m = 5 |
81 |
Correct |
0 ms |
263860 KB |
n = 4297, m = 5 |
82 |
Correct |
3 ms |
263860 KB |
n = 4662, m = 48 |
83 |
Correct |
6 ms |
263860 KB |
n = 4753, m = 49 |
84 |
Correct |
3 ms |
263860 KB |
n = 4148, m = 46 |
85 |
Correct |
6 ms |
263860 KB |
n = 4906, m = 50 |
86 |
Correct |
3 ms |
263860 KB |
n = 4967, m = 50 |
87 |
Correct |
3 ms |
263860 KB |
n = 4828, m = 49 |
88 |
Correct |
3 ms |
263860 KB |
n = 4105, m = 45 |
89 |
Correct |
6 ms |
263860 KB |
n = 4954, m = 50 |
90 |
Correct |
3 ms |
263860 KB |
n = 4884, m = 49 |
91 |
Correct |
3 ms |
263860 KB |
n = 4307, m = 100 |
92 |
Correct |
9 ms |
263860 KB |
n = 4668, m = 100 |
93 |
Correct |
6 ms |
263860 KB |
n = 4647, m = 100 |
94 |
Correct |
6 ms |
263860 KB |
n = 4372, m = 100 |
95 |
Correct |
9 ms |
263860 KB |
n = 4791, m = 100 |
96 |
Correct |
6 ms |
263860 KB |
n = 4029, m = 100 |
97 |
Correct |
3 ms |
263860 KB |
n = 4439, m = 100 |
98 |
Correct |
6 ms |
263860 KB |
n = 4018, m = 100 |
99 |
Correct |
6 ms |
263860 KB |
n = 4979, m = 100 |
100 |
Correct |
9 ms |
263860 KB |
n = 4996, m = 89 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
263860 KB |
n = 13, m = 1 |
2 |
Correct |
0 ms |
263860 KB |
n = 18, m = 1 |
3 |
Correct |
0 ms |
263860 KB |
n = 17, m = 1 |
4 |
Correct |
0 ms |
263860 KB |
n = 1, m = 1 |
5 |
Correct |
0 ms |
263860 KB |
n = 20, m = 1 |
6 |
Correct |
0 ms |
263860 KB |
n = 20, m = 1 |
7 |
Correct |
0 ms |
263860 KB |
n = 20, m = 1 |
8 |
Correct |
0 ms |
263860 KB |
n = 20, m = 5 |
9 |
Correct |
0 ms |
263860 KB |
n = 18, m = 3 |
10 |
Correct |
0 ms |
263860 KB |
n = 17, m = 2 |
11 |
Correct |
0 ms |
263860 KB |
n = 20, m = 2 |
12 |
Correct |
0 ms |
263860 KB |
n = 17, m = 4 |
13 |
Correct |
0 ms |
263860 KB |
n = 17, m = 6 |
14 |
Correct |
0 ms |
263860 KB |
n = 17, m = 1 |
15 |
Correct |
0 ms |
263860 KB |
n = 17, m = 4 |
16 |
Correct |
0 ms |
263860 KB |
n = 13, m = 3 |
17 |
Correct |
0 ms |
263860 KB |
n = 18, m = 4 |
18 |
Correct |
0 ms |
263860 KB |
n = 20, m = 10 |
19 |
Correct |
0 ms |
263860 KB |
n = 19, m = 10 |
20 |
Correct |
0 ms |
263860 KB |
n = 100, m = 5 |
21 |
Correct |
0 ms |
263860 KB |
n = 90, m = 3 |
22 |
Correct |
0 ms |
263860 KB |
n = 86, m = 2 |
23 |
Correct |
0 ms |
263860 KB |
n = 81, m = 4 |
24 |
Correct |
0 ms |
263860 KB |
n = 89, m = 10 |
25 |
Correct |
0 ms |
263860 KB |
n = 81, m = 23 |
26 |
Correct |
0 ms |
263860 KB |
n = 86, m = 8 |
27 |
Correct |
0 ms |
263860 KB |
n = 53, m = 22 |
28 |
Correct |
0 ms |
263860 KB |
n = 89, m = 35 |
29 |
Correct |
0 ms |
263860 KB |
n = 63, m = 25 |
30 |
Correct |
0 ms |
263860 KB |
n = 100, m = 50 |
31 |
Correct |
0 ms |
263860 KB |
n = 99, m = 50 |
32 |
Correct |
0 ms |
263860 KB |
n = 13, m = 4 |
33 |
Correct |
0 ms |
263860 KB |
n = 86, m = 2 |
34 |
Correct |
0 ms |
263860 KB |
n = 88, m = 2 |
35 |
Correct |
0 ms |
263860 KB |
n = 86, m = 2 |
36 |
Correct |
0 ms |
263860 KB |
n = 81, m = 6 |
37 |
Correct |
0 ms |
263860 KB |
n = 98, m = 7 |
38 |
Correct |
0 ms |
263860 KB |
n = 92, m = 7 |
39 |
Correct |
0 ms |
263860 KB |
n = 88, m = 21 |
40 |
Correct |
0 ms |
263860 KB |
n = 90, m = 21 |
41 |
Correct |
0 ms |
263860 KB |
n = 98, m = 22 |
42 |
Correct |
0 ms |
263860 KB |
n = 11, m = 2 |
43 |
Correct |
0 ms |
263860 KB |
n = 11, m = 2 |
44 |
Correct |
0 ms |
263860 KB |
n = 13, m = 3 |
45 |
Correct |
0 ms |
263860 KB |
n = 86, m = 2 |
46 |
Correct |
0 ms |
263860 KB |
n = 81, m = 2 |
47 |
Correct |
0 ms |
263860 KB |
n = 93, m = 2 |
48 |
Correct |
0 ms |
263860 KB |
n = 81, m = 2 |
49 |
Correct |
0 ms |
263860 KB |
n = 86, m = 2 |
50 |
Correct |
0 ms |
263860 KB |
n = 90, m = 2 |
51 |
Correct |
0 ms |
263860 KB |
n = 87, m = 2 |
52 |
Correct |
0 ms |
263860 KB |
n = 97, m = 2 |
53 |
Correct |
0 ms |
263860 KB |
n = 85, m = 2 |
54 |
Correct |
0 ms |
263860 KB |
n = 88, m = 7 |
55 |
Correct |
0 ms |
263860 KB |
n = 96, m = 7 |
56 |
Correct |
0 ms |
263860 KB |
n = 85, m = 7 |
57 |
Correct |
0 ms |
263860 KB |
n = 92, m = 7 |
58 |
Correct |
0 ms |
263860 KB |
n = 92, m = 7 |
59 |
Correct |
0 ms |
263860 KB |
n = 86, m = 7 |
60 |
Correct |
0 ms |
263860 KB |
n = 87, m = 7 |
61 |
Correct |
0 ms |
263860 KB |
n = 100, m = 7 |
62 |
Correct |
0 ms |
263860 KB |
n = 100, m = 7 |
63 |
Correct |
0 ms |
263860 KB |
n = 92, m = 21 |
64 |
Correct |
0 ms |
263860 KB |
n = 93, m = 22 |
65 |
Correct |
0 ms |
263860 KB |
n = 95, m = 22 |
66 |
Correct |
0 ms |
263860 KB |
n = 98, m = 22 |
67 |
Correct |
0 ms |
263860 KB |
n = 94, m = 22 |
68 |
Correct |
0 ms |
263860 KB |
n = 93, m = 22 |
69 |
Correct |
0 ms |
263860 KB |
n = 88, m = 21 |
70 |
Correct |
0 ms |
263860 KB |
n = 83, m = 20 |
71 |
Correct |
0 ms |
263860 KB |
n = 99, m = 23 |
72 |
Correct |
0 ms |
263860 KB |
n = 96, m = 19 |
73 |
Correct |
0 ms |
263860 KB |
n = 4825, m = 5 |
74 |
Correct |
0 ms |
263860 KB |
n = 4384, m = 5 |
75 |
Correct |
0 ms |
263860 KB |
n = 4528, m = 5 |
76 |
Correct |
3 ms |
263860 KB |
n = 4980, m = 5 |
77 |
Correct |
0 ms |
263860 KB |
n = 4730, m = 5 |
78 |
Correct |
0 ms |
263860 KB |
n = 4784, m = 5 |
79 |
Correct |
0 ms |
263860 KB |
n = 4875, m = 5 |
80 |
Correct |
0 ms |
263860 KB |
n = 4576, m = 5 |
81 |
Correct |
0 ms |
263860 KB |
n = 4297, m = 5 |
82 |
Correct |
3 ms |
263860 KB |
n = 4662, m = 48 |
83 |
Correct |
6 ms |
263860 KB |
n = 4753, m = 49 |
84 |
Correct |
3 ms |
263860 KB |
n = 4148, m = 46 |
85 |
Correct |
6 ms |
263860 KB |
n = 4906, m = 50 |
86 |
Correct |
3 ms |
263860 KB |
n = 4967, m = 50 |
87 |
Correct |
3 ms |
263860 KB |
n = 4828, m = 49 |
88 |
Correct |
3 ms |
263860 KB |
n = 4105, m = 45 |
89 |
Correct |
6 ms |
263860 KB |
n = 4954, m = 50 |
90 |
Correct |
3 ms |
263860 KB |
n = 4884, m = 49 |
91 |
Correct |
3 ms |
263860 KB |
n = 4307, m = 100 |
92 |
Correct |
9 ms |
263860 KB |
n = 4668, m = 100 |
93 |
Correct |
6 ms |
263860 KB |
n = 4647, m = 100 |
94 |
Correct |
6 ms |
263860 KB |
n = 4372, m = 100 |
95 |
Correct |
9 ms |
263860 KB |
n = 4791, m = 100 |
96 |
Correct |
6 ms |
263860 KB |
n = 4029, m = 100 |
97 |
Correct |
3 ms |
263860 KB |
n = 4439, m = 100 |
98 |
Correct |
6 ms |
263860 KB |
n = 4018, m = 100 |
99 |
Correct |
6 ms |
263860 KB |
n = 4979, m = 100 |
100 |
Correct |
9 ms |
263860 KB |
n = 4996, m = 89 |
101 |
Correct |
53 ms |
264948 KB |
n = 178952, m = 10 |
102 |
Correct |
56 ms |
264960 KB |
n = 180674, m = 10 |
103 |
Correct |
56 ms |
264912 KB |
n = 167639, m = 10 |
104 |
Correct |
49 ms |
264936 KB |
n = 172892, m = 10 |
105 |
Correct |
53 ms |
264924 KB |
n = 168125, m = 10 |
106 |
Correct |
43 ms |
264912 KB |
n = 166514, m = 10 |
107 |
Correct |
66 ms |
264960 KB |
n = 183874, m = 10 |
108 |
Correct |
53 ms |
264996 KB |
n = 194560, m = 10 |
109 |
Correct |
46 ms |
264924 KB |
n = 171994, m = 10 |
110 |
Correct |
283 ms |
264912 KB |
n = 165207, m = 100 |
111 |
Correct |
259 ms |
264984 KB |
n = 188459, m = 100 |
112 |
Correct |
269 ms |
264900 KB |
n = 162137, m = 100 |
113 |
Correct |
216 ms |
264924 KB |
n = 169691, m = 100 |
114 |
Correct |
256 ms |
264972 KB |
n = 187642, m = 100 |
115 |
Correct |
246 ms |
264924 KB |
n = 168456, m = 100 |
116 |
Correct |
236 ms |
264960 KB |
n = 180980, m = 100 |
117 |
Correct |
259 ms |
264984 KB |
n = 191687, m = 100 |
118 |
Correct |
236 ms |
264912 KB |
n = 166437, m = 100 |
119 |
Correct |
266 ms |
264972 KB |
n = 186520, m = 100 |
120 |
Correct |
276 ms |
264912 KB |
n = 166675, m = 100 |
121 |
Correct |
293 ms |
264972 KB |
n = 187725, m = 100 |
122 |
Correct |
196 ms |
264900 KB |
n = 161455, m = 100 |
123 |
Correct |
253 ms |
264996 KB |
n = 192977, m = 100 |
124 |
Correct |
263 ms |
264996 KB |
n = 192612, m = 100 |
125 |
Correct |
233 ms |
264996 KB |
n = 196512, m = 100 |
126 |
Correct |
253 ms |
265008 KB |
n = 198968, m = 100 |
127 |
Correct |
216 ms |
264912 KB |
n = 166659, m = 100 |
128 |
Correct |
169 ms |
265008 KB |
n = 199997, m = 34 |
129 |
Correct |
29 ms |
265008 KB |
n = 200000, m = 1 |
130 |
Incorrect |
33 ms |
265008 KB |
char #102 differ - expected: '?', found: '_' |
131 |
Halted |
0 ms |
0 KB |
- |