#include <bits/stdc++.h>
#include "paint.h"
#warning That's not FB, that's my FB
using namespace std;
using integer = int;
int modulo = (int)1e9 + 12345;
int n, k;
int a[200005], v[105];
int spb[200005], spw[200005];
int dp[200005][105], ways[200005][105], spdp[200005][105];
int prev_b[200005];
int p[200005];
int f[200005], spf[200005];
string solve_puzzle(string s, vector<integer> c)
{
n = s.size();
k = c.size();
for (int i = 1; i <= k; i++)
v[i] = c[i - 1];
for (int i = 1; i <= n; i++)
{
if (s[i - 1] == 'X')
a[i] = 0;
else if (s[i - 1] == '_')
a[i] = 1;
else
a[i] = 2;
}
prev_b[0] = 0;
for (int i = 1; i <= n; i++)
{
if (a[i] == 0)
prev_b[i] = i;
else
prev_b[i] = prev_b[i - 1];
}
for (int i = 1; i <= n; i++)
{
spb[i] = spb[i - 1];
spw[i] = spw[i - 1];
if (a[i] == 0)
spb[i]++;
else if (a[i] == 1)
spw[i]++;
}
ways[n + 2][k + 1] = 1;
ways[n + 1][k + 1] = 1;
for (int i = n; i >= 1; i--)
{
if (a[i] != 0)
ways[i][k + 1] = ways[i + 1][k + 1];
for (int j = 1; j <= k; j++)
{
if (a[i] == 1)
ways[i][j] = ways[i + 1][j];
else if (a[i] == 0)
{
if (i + v[j] - 1 <= n and spw[i + v[j] - 1] == spw[i - 1])
{
if (i + v[j] == n + 1 or a[i + v[j]] != 0)
ways[i][j] = ways[i + v[j] + 1][j + 1];
}
}
else
{
if (i + v[j] - 1 <= n and spw[i + v[j] - 1] == spw[i - 1])
{
//cout << i << ' ' << j << endl;
if (i + v[j] == n + 1 or a[i + v[j]] != 0)
ways[i][j] = ways[i + v[j] + 1][j + 1];
}
if (a[i] != 0)
ways[i][j] += ways[i + 1][j];
if (ways[i][j] >= modulo)
ways[i][j] -= modulo;
}
//cout << i << ' ' << j << ' ' << ways[i][j] << endl;
}
}
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= k; j++)
{
if (i - v[j] + 1 >= 1 and spw[i] == spw[i - v[j]] and (i == n or a[i + 1] != 0))
{
if (j == 1 and spb[i - v[j]] == 0)
dp[i][j] = 1;
else if (j != 1)
{
int x = prev_b[i - v[j]];
if (x == 0)
dp[i][j] = spdp[max(0,i - v[j] - 1)][j - 1];
else
dp[i][j] = (spdp[i - v[j] - 1][j - 1] + modulo - spdp[x - 1][j - 1]) % modulo;
}
}
spdp[i][j] = (spdp[i - 1][j] + dp[i][j]) % modulo;
}
}
int nrw = 0;
for (int j = 1; j <= k; j++)
{
for (int i = 1; i <= n; i++)
{
f[i] = (__int128)dp[i][j] * ways[i + 2][j + 1] % modulo;
spf[i] = (spf[i - 1] + f[i]) % modulo;
}
if (j == 1)
nrw = spf[n];
for (int i = 1; i <= n; i++)
{
int inc = (spf[min(n,i + v[j] - 1)] - spf[i - 1] + modulo) % modulo;
p[i] = (p[i] + inc) % modulo;
}
}
string ans;
for (int i = 1; i <= n; i++)
{
if (p[i] == 0)
ans.push_back('_');
else if (p[i] == nrw)
ans.push_back('X');
else
ans.push_back('?');
}
return ans;
}
Compilation message
paint.cpp:3:2: warning: #warning That's not FB, that's my FB [-Wcpp]
3 | #warning That's not FB, that's my FB
| ^~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
6492 KB |
n = 13, m = 1 |
2 |
Correct |
1 ms |
6492 KB |
n = 18, m = 1 |
3 |
Correct |
1 ms |
6492 KB |
n = 17, m = 1 |
4 |
Correct |
1 ms |
8540 KB |
n = 1, m = 1 |
5 |
Correct |
1 ms |
8540 KB |
n = 20, m = 1 |
6 |
Correct |
1 ms |
6492 KB |
n = 20, m = 1 |
7 |
Correct |
1 ms |
6492 KB |
n = 20, m = 1 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
6492 KB |
n = 13, m = 1 |
2 |
Correct |
1 ms |
6492 KB |
n = 18, m = 1 |
3 |
Correct |
1 ms |
6492 KB |
n = 17, m = 1 |
4 |
Correct |
1 ms |
8540 KB |
n = 1, m = 1 |
5 |
Correct |
1 ms |
8540 KB |
n = 20, m = 1 |
6 |
Correct |
1 ms |
6492 KB |
n = 20, m = 1 |
7 |
Correct |
1 ms |
6492 KB |
n = 20, m = 1 |
8 |
Correct |
1 ms |
6488 KB |
n = 20, m = 5 |
9 |
Correct |
1 ms |
6492 KB |
n = 18, m = 3 |
10 |
Correct |
1 ms |
6492 KB |
n = 17, m = 2 |
11 |
Correct |
1 ms |
6492 KB |
n = 20, m = 2 |
12 |
Correct |
1 ms |
6492 KB |
n = 17, m = 4 |
13 |
Correct |
1 ms |
8540 KB |
n = 17, m = 6 |
14 |
Correct |
1 ms |
6492 KB |
n = 17, m = 1 |
15 |
Correct |
1 ms |
6492 KB |
n = 17, m = 4 |
16 |
Correct |
1 ms |
6488 KB |
n = 13, m = 3 |
17 |
Correct |
1 ms |
6492 KB |
n = 18, m = 4 |
18 |
Correct |
1 ms |
8540 KB |
n = 20, m = 10 |
19 |
Correct |
1 ms |
8536 KB |
n = 19, m = 10 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
6492 KB |
n = 13, m = 1 |
2 |
Correct |
1 ms |
6492 KB |
n = 18, m = 1 |
3 |
Correct |
1 ms |
6492 KB |
n = 17, m = 1 |
4 |
Correct |
1 ms |
8540 KB |
n = 1, m = 1 |
5 |
Correct |
1 ms |
8540 KB |
n = 20, m = 1 |
6 |
Correct |
1 ms |
6492 KB |
n = 20, m = 1 |
7 |
Correct |
1 ms |
6492 KB |
n = 20, m = 1 |
8 |
Correct |
1 ms |
6488 KB |
n = 20, m = 5 |
9 |
Correct |
1 ms |
6492 KB |
n = 18, m = 3 |
10 |
Correct |
1 ms |
6492 KB |
n = 17, m = 2 |
11 |
Correct |
1 ms |
6492 KB |
n = 20, m = 2 |
12 |
Correct |
1 ms |
6492 KB |
n = 17, m = 4 |
13 |
Correct |
1 ms |
8540 KB |
n = 17, m = 6 |
14 |
Correct |
1 ms |
6492 KB |
n = 17, m = 1 |
15 |
Correct |
1 ms |
6492 KB |
n = 17, m = 4 |
16 |
Correct |
1 ms |
6488 KB |
n = 13, m = 3 |
17 |
Correct |
1 ms |
6492 KB |
n = 18, m = 4 |
18 |
Correct |
1 ms |
8540 KB |
n = 20, m = 10 |
19 |
Correct |
1 ms |
8536 KB |
n = 19, m = 10 |
20 |
Correct |
1 ms |
6492 KB |
n = 100, m = 5 |
21 |
Correct |
1 ms |
6488 KB |
n = 90, m = 3 |
22 |
Correct |
1 ms |
6492 KB |
n = 86, m = 2 |
23 |
Correct |
1 ms |
6492 KB |
n = 81, m = 4 |
24 |
Correct |
1 ms |
6492 KB |
n = 89, m = 10 |
25 |
Correct |
1 ms |
6492 KB |
n = 81, m = 23 |
26 |
Correct |
1 ms |
6492 KB |
n = 86, m = 8 |
27 |
Correct |
1 ms |
8540 KB |
n = 53, m = 22 |
28 |
Correct |
1 ms |
8540 KB |
n = 89, m = 35 |
29 |
Correct |
1 ms |
6492 KB |
n = 63, m = 25 |
30 |
Correct |
1 ms |
6492 KB |
n = 100, m = 50 |
31 |
Correct |
1 ms |
6492 KB |
n = 99, m = 50 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
6492 KB |
n = 13, m = 1 |
2 |
Correct |
1 ms |
6492 KB |
n = 18, m = 1 |
3 |
Correct |
1 ms |
6492 KB |
n = 17, m = 1 |
4 |
Correct |
1 ms |
8540 KB |
n = 1, m = 1 |
5 |
Correct |
1 ms |
8540 KB |
n = 20, m = 1 |
6 |
Correct |
1 ms |
6492 KB |
n = 20, m = 1 |
7 |
Correct |
1 ms |
6492 KB |
n = 20, m = 1 |
8 |
Correct |
1 ms |
6488 KB |
n = 20, m = 5 |
9 |
Correct |
1 ms |
6492 KB |
n = 18, m = 3 |
10 |
Correct |
1 ms |
6492 KB |
n = 17, m = 2 |
11 |
Correct |
1 ms |
6492 KB |
n = 20, m = 2 |
12 |
Correct |
1 ms |
6492 KB |
n = 17, m = 4 |
13 |
Correct |
1 ms |
8540 KB |
n = 17, m = 6 |
14 |
Correct |
1 ms |
6492 KB |
n = 17, m = 1 |
15 |
Correct |
1 ms |
6492 KB |
n = 17, m = 4 |
16 |
Correct |
1 ms |
6488 KB |
n = 13, m = 3 |
17 |
Correct |
1 ms |
6492 KB |
n = 18, m = 4 |
18 |
Correct |
1 ms |
8540 KB |
n = 20, m = 10 |
19 |
Correct |
1 ms |
8536 KB |
n = 19, m = 10 |
20 |
Correct |
1 ms |
6492 KB |
n = 100, m = 5 |
21 |
Correct |
1 ms |
6488 KB |
n = 90, m = 3 |
22 |
Correct |
1 ms |
6492 KB |
n = 86, m = 2 |
23 |
Correct |
1 ms |
6492 KB |
n = 81, m = 4 |
24 |
Correct |
1 ms |
6492 KB |
n = 89, m = 10 |
25 |
Correct |
1 ms |
6492 KB |
n = 81, m = 23 |
26 |
Correct |
1 ms |
6492 KB |
n = 86, m = 8 |
27 |
Correct |
1 ms |
8540 KB |
n = 53, m = 22 |
28 |
Correct |
1 ms |
8540 KB |
n = 89, m = 35 |
29 |
Correct |
1 ms |
6492 KB |
n = 63, m = 25 |
30 |
Correct |
1 ms |
6492 KB |
n = 100, m = 50 |
31 |
Correct |
1 ms |
6492 KB |
n = 99, m = 50 |
32 |
Correct |
1 ms |
6492 KB |
n = 13, m = 4 |
33 |
Correct |
1 ms |
6504 KB |
n = 86, m = 2 |
34 |
Correct |
1 ms |
6488 KB |
n = 88, m = 2 |
35 |
Correct |
1 ms |
6492 KB |
n = 86, m = 2 |
36 |
Correct |
1 ms |
6492 KB |
n = 81, m = 6 |
37 |
Correct |
1 ms |
6492 KB |
n = 98, m = 7 |
38 |
Correct |
1 ms |
6492 KB |
n = 92, m = 7 |
39 |
Correct |
1 ms |
8536 KB |
n = 88, m = 21 |
40 |
Correct |
1 ms |
6492 KB |
n = 90, m = 21 |
41 |
Correct |
1 ms |
6492 KB |
n = 98, m = 22 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
6492 KB |
n = 13, m = 1 |
2 |
Correct |
1 ms |
6492 KB |
n = 18, m = 1 |
3 |
Correct |
1 ms |
6492 KB |
n = 17, m = 1 |
4 |
Correct |
1 ms |
8540 KB |
n = 1, m = 1 |
5 |
Correct |
1 ms |
8540 KB |
n = 20, m = 1 |
6 |
Correct |
1 ms |
6492 KB |
n = 20, m = 1 |
7 |
Correct |
1 ms |
6492 KB |
n = 20, m = 1 |
8 |
Correct |
1 ms |
6488 KB |
n = 20, m = 5 |
9 |
Correct |
1 ms |
6492 KB |
n = 18, m = 3 |
10 |
Correct |
1 ms |
6492 KB |
n = 17, m = 2 |
11 |
Correct |
1 ms |
6492 KB |
n = 20, m = 2 |
12 |
Correct |
1 ms |
6492 KB |
n = 17, m = 4 |
13 |
Correct |
1 ms |
8540 KB |
n = 17, m = 6 |
14 |
Correct |
1 ms |
6492 KB |
n = 17, m = 1 |
15 |
Correct |
1 ms |
6492 KB |
n = 17, m = 4 |
16 |
Correct |
1 ms |
6488 KB |
n = 13, m = 3 |
17 |
Correct |
1 ms |
6492 KB |
n = 18, m = 4 |
18 |
Correct |
1 ms |
8540 KB |
n = 20, m = 10 |
19 |
Correct |
1 ms |
8536 KB |
n = 19, m = 10 |
20 |
Correct |
1 ms |
6492 KB |
n = 100, m = 5 |
21 |
Correct |
1 ms |
6488 KB |
n = 90, m = 3 |
22 |
Correct |
1 ms |
6492 KB |
n = 86, m = 2 |
23 |
Correct |
1 ms |
6492 KB |
n = 81, m = 4 |
24 |
Correct |
1 ms |
6492 KB |
n = 89, m = 10 |
25 |
Correct |
1 ms |
6492 KB |
n = 81, m = 23 |
26 |
Correct |
1 ms |
6492 KB |
n = 86, m = 8 |
27 |
Correct |
1 ms |
8540 KB |
n = 53, m = 22 |
28 |
Correct |
1 ms |
8540 KB |
n = 89, m = 35 |
29 |
Correct |
1 ms |
6492 KB |
n = 63, m = 25 |
30 |
Correct |
1 ms |
6492 KB |
n = 100, m = 50 |
31 |
Correct |
1 ms |
6492 KB |
n = 99, m = 50 |
32 |
Correct |
1 ms |
6492 KB |
n = 13, m = 4 |
33 |
Correct |
1 ms |
6504 KB |
n = 86, m = 2 |
34 |
Correct |
1 ms |
6488 KB |
n = 88, m = 2 |
35 |
Correct |
1 ms |
6492 KB |
n = 86, m = 2 |
36 |
Correct |
1 ms |
6492 KB |
n = 81, m = 6 |
37 |
Correct |
1 ms |
6492 KB |
n = 98, m = 7 |
38 |
Correct |
1 ms |
6492 KB |
n = 92, m = 7 |
39 |
Correct |
1 ms |
8536 KB |
n = 88, m = 21 |
40 |
Correct |
1 ms |
6492 KB |
n = 90, m = 21 |
41 |
Correct |
1 ms |
6492 KB |
n = 98, m = 22 |
42 |
Correct |
1 ms |
6492 KB |
n = 11, m = 2 |
43 |
Correct |
1 ms |
6492 KB |
n = 11, m = 2 |
44 |
Correct |
1 ms |
6492 KB |
n = 13, m = 3 |
45 |
Correct |
1 ms |
6492 KB |
n = 86, m = 2 |
46 |
Correct |
1 ms |
6492 KB |
n = 81, m = 2 |
47 |
Correct |
1 ms |
6492 KB |
n = 93, m = 2 |
48 |
Correct |
1 ms |
6596 KB |
n = 81, m = 2 |
49 |
Correct |
1 ms |
6488 KB |
n = 86, m = 2 |
50 |
Correct |
1 ms |
6492 KB |
n = 90, m = 2 |
51 |
Correct |
1 ms |
6492 KB |
n = 87, m = 2 |
52 |
Correct |
1 ms |
6492 KB |
n = 97, m = 2 |
53 |
Correct |
1 ms |
6492 KB |
n = 85, m = 2 |
54 |
Correct |
1 ms |
6492 KB |
n = 88, m = 7 |
55 |
Correct |
1 ms |
6612 KB |
n = 96, m = 7 |
56 |
Correct |
1 ms |
6492 KB |
n = 85, m = 7 |
57 |
Correct |
1 ms |
6492 KB |
n = 92, m = 7 |
58 |
Correct |
1 ms |
6492 KB |
n = 92, m = 7 |
59 |
Correct |
1 ms |
6492 KB |
n = 86, m = 7 |
60 |
Correct |
1 ms |
6492 KB |
n = 87, m = 7 |
61 |
Correct |
1 ms |
6492 KB |
n = 100, m = 7 |
62 |
Correct |
1 ms |
6492 KB |
n = 100, m = 7 |
63 |
Correct |
1 ms |
6492 KB |
n = 92, m = 21 |
64 |
Correct |
1 ms |
6492 KB |
n = 93, m = 22 |
65 |
Correct |
1 ms |
6492 KB |
n = 95, m = 22 |
66 |
Correct |
1 ms |
6492 KB |
n = 98, m = 22 |
67 |
Correct |
1 ms |
6492 KB |
n = 94, m = 22 |
68 |
Correct |
1 ms |
6492 KB |
n = 93, m = 22 |
69 |
Correct |
1 ms |
8540 KB |
n = 88, m = 21 |
70 |
Correct |
1 ms |
6492 KB |
n = 83, m = 20 |
71 |
Correct |
1 ms |
6492 KB |
n = 99, m = 23 |
72 |
Correct |
1 ms |
6492 KB |
n = 96, m = 19 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
6492 KB |
n = 13, m = 1 |
2 |
Correct |
1 ms |
6492 KB |
n = 18, m = 1 |
3 |
Correct |
1 ms |
6492 KB |
n = 17, m = 1 |
4 |
Correct |
1 ms |
8540 KB |
n = 1, m = 1 |
5 |
Correct |
1 ms |
8540 KB |
n = 20, m = 1 |
6 |
Correct |
1 ms |
6492 KB |
n = 20, m = 1 |
7 |
Correct |
1 ms |
6492 KB |
n = 20, m = 1 |
8 |
Correct |
1 ms |
6488 KB |
n = 20, m = 5 |
9 |
Correct |
1 ms |
6492 KB |
n = 18, m = 3 |
10 |
Correct |
1 ms |
6492 KB |
n = 17, m = 2 |
11 |
Correct |
1 ms |
6492 KB |
n = 20, m = 2 |
12 |
Correct |
1 ms |
6492 KB |
n = 17, m = 4 |
13 |
Correct |
1 ms |
8540 KB |
n = 17, m = 6 |
14 |
Correct |
1 ms |
6492 KB |
n = 17, m = 1 |
15 |
Correct |
1 ms |
6492 KB |
n = 17, m = 4 |
16 |
Correct |
1 ms |
6488 KB |
n = 13, m = 3 |
17 |
Correct |
1 ms |
6492 KB |
n = 18, m = 4 |
18 |
Correct |
1 ms |
8540 KB |
n = 20, m = 10 |
19 |
Correct |
1 ms |
8536 KB |
n = 19, m = 10 |
20 |
Correct |
1 ms |
6492 KB |
n = 100, m = 5 |
21 |
Correct |
1 ms |
6488 KB |
n = 90, m = 3 |
22 |
Correct |
1 ms |
6492 KB |
n = 86, m = 2 |
23 |
Correct |
1 ms |
6492 KB |
n = 81, m = 4 |
24 |
Correct |
1 ms |
6492 KB |
n = 89, m = 10 |
25 |
Correct |
1 ms |
6492 KB |
n = 81, m = 23 |
26 |
Correct |
1 ms |
6492 KB |
n = 86, m = 8 |
27 |
Correct |
1 ms |
8540 KB |
n = 53, m = 22 |
28 |
Correct |
1 ms |
8540 KB |
n = 89, m = 35 |
29 |
Correct |
1 ms |
6492 KB |
n = 63, m = 25 |
30 |
Correct |
1 ms |
6492 KB |
n = 100, m = 50 |
31 |
Correct |
1 ms |
6492 KB |
n = 99, m = 50 |
32 |
Correct |
1 ms |
6492 KB |
n = 13, m = 4 |
33 |
Correct |
1 ms |
6504 KB |
n = 86, m = 2 |
34 |
Correct |
1 ms |
6488 KB |
n = 88, m = 2 |
35 |
Correct |
1 ms |
6492 KB |
n = 86, m = 2 |
36 |
Correct |
1 ms |
6492 KB |
n = 81, m = 6 |
37 |
Correct |
1 ms |
6492 KB |
n = 98, m = 7 |
38 |
Correct |
1 ms |
6492 KB |
n = 92, m = 7 |
39 |
Correct |
1 ms |
8536 KB |
n = 88, m = 21 |
40 |
Correct |
1 ms |
6492 KB |
n = 90, m = 21 |
41 |
Correct |
1 ms |
6492 KB |
n = 98, m = 22 |
42 |
Correct |
1 ms |
6492 KB |
n = 11, m = 2 |
43 |
Correct |
1 ms |
6492 KB |
n = 11, m = 2 |
44 |
Correct |
1 ms |
6492 KB |
n = 13, m = 3 |
45 |
Correct |
1 ms |
6492 KB |
n = 86, m = 2 |
46 |
Correct |
1 ms |
6492 KB |
n = 81, m = 2 |
47 |
Correct |
1 ms |
6492 KB |
n = 93, m = 2 |
48 |
Correct |
1 ms |
6596 KB |
n = 81, m = 2 |
49 |
Correct |
1 ms |
6488 KB |
n = 86, m = 2 |
50 |
Correct |
1 ms |
6492 KB |
n = 90, m = 2 |
51 |
Correct |
1 ms |
6492 KB |
n = 87, m = 2 |
52 |
Correct |
1 ms |
6492 KB |
n = 97, m = 2 |
53 |
Correct |
1 ms |
6492 KB |
n = 85, m = 2 |
54 |
Correct |
1 ms |
6492 KB |
n = 88, m = 7 |
55 |
Correct |
1 ms |
6612 KB |
n = 96, m = 7 |
56 |
Correct |
1 ms |
6492 KB |
n = 85, m = 7 |
57 |
Correct |
1 ms |
6492 KB |
n = 92, m = 7 |
58 |
Correct |
1 ms |
6492 KB |
n = 92, m = 7 |
59 |
Correct |
1 ms |
6492 KB |
n = 86, m = 7 |
60 |
Correct |
1 ms |
6492 KB |
n = 87, m = 7 |
61 |
Correct |
1 ms |
6492 KB |
n = 100, m = 7 |
62 |
Correct |
1 ms |
6492 KB |
n = 100, m = 7 |
63 |
Correct |
1 ms |
6492 KB |
n = 92, m = 21 |
64 |
Correct |
1 ms |
6492 KB |
n = 93, m = 22 |
65 |
Correct |
1 ms |
6492 KB |
n = 95, m = 22 |
66 |
Correct |
1 ms |
6492 KB |
n = 98, m = 22 |
67 |
Correct |
1 ms |
6492 KB |
n = 94, m = 22 |
68 |
Correct |
1 ms |
6492 KB |
n = 93, m = 22 |
69 |
Correct |
1 ms |
8540 KB |
n = 88, m = 21 |
70 |
Correct |
1 ms |
6492 KB |
n = 83, m = 20 |
71 |
Correct |
1 ms |
6492 KB |
n = 99, m = 23 |
72 |
Correct |
1 ms |
6492 KB |
n = 96, m = 19 |
73 |
Correct |
2 ms |
11864 KB |
n = 4825, m = 5 |
74 |
Correct |
1 ms |
10844 KB |
n = 4384, m = 5 |
75 |
Correct |
2 ms |
12636 KB |
n = 4528, m = 5 |
76 |
Correct |
2 ms |
11356 KB |
n = 4980, m = 5 |
77 |
Correct |
2 ms |
8028 KB |
n = 4730, m = 5 |
78 |
Correct |
2 ms |
9308 KB |
n = 4784, m = 5 |
79 |
Correct |
2 ms |
11612 KB |
n = 4875, m = 5 |
80 |
Correct |
2 ms |
8028 KB |
n = 4576, m = 5 |
81 |
Correct |
2 ms |
12380 KB |
n = 4297, m = 5 |
82 |
Correct |
5 ms |
10588 KB |
n = 4662, m = 48 |
83 |
Correct |
6 ms |
9752 KB |
n = 4753, m = 49 |
84 |
Correct |
5 ms |
8976 KB |
n = 4148, m = 46 |
85 |
Correct |
6 ms |
9564 KB |
n = 4906, m = 50 |
86 |
Correct |
6 ms |
10636 KB |
n = 4967, m = 50 |
87 |
Correct |
6 ms |
9564 KB |
n = 4828, m = 49 |
88 |
Correct |
5 ms |
9308 KB |
n = 4105, m = 45 |
89 |
Correct |
6 ms |
10844 KB |
n = 4954, m = 50 |
90 |
Correct |
6 ms |
13736 KB |
n = 4884, m = 49 |
91 |
Correct |
9 ms |
12380 KB |
n = 4307, m = 100 |
92 |
Correct |
10 ms |
13784 KB |
n = 4668, m = 100 |
93 |
Correct |
11 ms |
12636 KB |
n = 4647, m = 100 |
94 |
Correct |
9 ms |
13776 KB |
n = 4372, m = 100 |
95 |
Correct |
10 ms |
13604 KB |
n = 4791, m = 100 |
96 |
Correct |
9 ms |
12892 KB |
n = 4029, m = 100 |
97 |
Correct |
9 ms |
9564 KB |
n = 4439, m = 100 |
98 |
Correct |
9 ms |
13660 KB |
n = 4018, m = 100 |
99 |
Correct |
12 ms |
9564 KB |
n = 4979, m = 100 |
100 |
Correct |
10 ms |
13916 KB |
n = 4996, m = 89 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
6492 KB |
n = 13, m = 1 |
2 |
Correct |
1 ms |
6492 KB |
n = 18, m = 1 |
3 |
Correct |
1 ms |
6492 KB |
n = 17, m = 1 |
4 |
Correct |
1 ms |
8540 KB |
n = 1, m = 1 |
5 |
Correct |
1 ms |
8540 KB |
n = 20, m = 1 |
6 |
Correct |
1 ms |
6492 KB |
n = 20, m = 1 |
7 |
Correct |
1 ms |
6492 KB |
n = 20, m = 1 |
8 |
Correct |
1 ms |
6488 KB |
n = 20, m = 5 |
9 |
Correct |
1 ms |
6492 KB |
n = 18, m = 3 |
10 |
Correct |
1 ms |
6492 KB |
n = 17, m = 2 |
11 |
Correct |
1 ms |
6492 KB |
n = 20, m = 2 |
12 |
Correct |
1 ms |
6492 KB |
n = 17, m = 4 |
13 |
Correct |
1 ms |
8540 KB |
n = 17, m = 6 |
14 |
Correct |
1 ms |
6492 KB |
n = 17, m = 1 |
15 |
Correct |
1 ms |
6492 KB |
n = 17, m = 4 |
16 |
Correct |
1 ms |
6488 KB |
n = 13, m = 3 |
17 |
Correct |
1 ms |
6492 KB |
n = 18, m = 4 |
18 |
Correct |
1 ms |
8540 KB |
n = 20, m = 10 |
19 |
Correct |
1 ms |
8536 KB |
n = 19, m = 10 |
20 |
Correct |
1 ms |
6492 KB |
n = 100, m = 5 |
21 |
Correct |
1 ms |
6488 KB |
n = 90, m = 3 |
22 |
Correct |
1 ms |
6492 KB |
n = 86, m = 2 |
23 |
Correct |
1 ms |
6492 KB |
n = 81, m = 4 |
24 |
Correct |
1 ms |
6492 KB |
n = 89, m = 10 |
25 |
Correct |
1 ms |
6492 KB |
n = 81, m = 23 |
26 |
Correct |
1 ms |
6492 KB |
n = 86, m = 8 |
27 |
Correct |
1 ms |
8540 KB |
n = 53, m = 22 |
28 |
Correct |
1 ms |
8540 KB |
n = 89, m = 35 |
29 |
Correct |
1 ms |
6492 KB |
n = 63, m = 25 |
30 |
Correct |
1 ms |
6492 KB |
n = 100, m = 50 |
31 |
Correct |
1 ms |
6492 KB |
n = 99, m = 50 |
32 |
Correct |
1 ms |
6492 KB |
n = 13, m = 4 |
33 |
Correct |
1 ms |
6504 KB |
n = 86, m = 2 |
34 |
Correct |
1 ms |
6488 KB |
n = 88, m = 2 |
35 |
Correct |
1 ms |
6492 KB |
n = 86, m = 2 |
36 |
Correct |
1 ms |
6492 KB |
n = 81, m = 6 |
37 |
Correct |
1 ms |
6492 KB |
n = 98, m = 7 |
38 |
Correct |
1 ms |
6492 KB |
n = 92, m = 7 |
39 |
Correct |
1 ms |
8536 KB |
n = 88, m = 21 |
40 |
Correct |
1 ms |
6492 KB |
n = 90, m = 21 |
41 |
Correct |
1 ms |
6492 KB |
n = 98, m = 22 |
42 |
Correct |
1 ms |
6492 KB |
n = 11, m = 2 |
43 |
Correct |
1 ms |
6492 KB |
n = 11, m = 2 |
44 |
Correct |
1 ms |
6492 KB |
n = 13, m = 3 |
45 |
Correct |
1 ms |
6492 KB |
n = 86, m = 2 |
46 |
Correct |
1 ms |
6492 KB |
n = 81, m = 2 |
47 |
Correct |
1 ms |
6492 KB |
n = 93, m = 2 |
48 |
Correct |
1 ms |
6596 KB |
n = 81, m = 2 |
49 |
Correct |
1 ms |
6488 KB |
n = 86, m = 2 |
50 |
Correct |
1 ms |
6492 KB |
n = 90, m = 2 |
51 |
Correct |
1 ms |
6492 KB |
n = 87, m = 2 |
52 |
Correct |
1 ms |
6492 KB |
n = 97, m = 2 |
53 |
Correct |
1 ms |
6492 KB |
n = 85, m = 2 |
54 |
Correct |
1 ms |
6492 KB |
n = 88, m = 7 |
55 |
Correct |
1 ms |
6612 KB |
n = 96, m = 7 |
56 |
Correct |
1 ms |
6492 KB |
n = 85, m = 7 |
57 |
Correct |
1 ms |
6492 KB |
n = 92, m = 7 |
58 |
Correct |
1 ms |
6492 KB |
n = 92, m = 7 |
59 |
Correct |
1 ms |
6492 KB |
n = 86, m = 7 |
60 |
Correct |
1 ms |
6492 KB |
n = 87, m = 7 |
61 |
Correct |
1 ms |
6492 KB |
n = 100, m = 7 |
62 |
Correct |
1 ms |
6492 KB |
n = 100, m = 7 |
63 |
Correct |
1 ms |
6492 KB |
n = 92, m = 21 |
64 |
Correct |
1 ms |
6492 KB |
n = 93, m = 22 |
65 |
Correct |
1 ms |
6492 KB |
n = 95, m = 22 |
66 |
Correct |
1 ms |
6492 KB |
n = 98, m = 22 |
67 |
Correct |
1 ms |
6492 KB |
n = 94, m = 22 |
68 |
Correct |
1 ms |
6492 KB |
n = 93, m = 22 |
69 |
Correct |
1 ms |
8540 KB |
n = 88, m = 21 |
70 |
Correct |
1 ms |
6492 KB |
n = 83, m = 20 |
71 |
Correct |
1 ms |
6492 KB |
n = 99, m = 23 |
72 |
Correct |
1 ms |
6492 KB |
n = 96, m = 19 |
73 |
Correct |
2 ms |
11864 KB |
n = 4825, m = 5 |
74 |
Correct |
1 ms |
10844 KB |
n = 4384, m = 5 |
75 |
Correct |
2 ms |
12636 KB |
n = 4528, m = 5 |
76 |
Correct |
2 ms |
11356 KB |
n = 4980, m = 5 |
77 |
Correct |
2 ms |
8028 KB |
n = 4730, m = 5 |
78 |
Correct |
2 ms |
9308 KB |
n = 4784, m = 5 |
79 |
Correct |
2 ms |
11612 KB |
n = 4875, m = 5 |
80 |
Correct |
2 ms |
8028 KB |
n = 4576, m = 5 |
81 |
Correct |
2 ms |
12380 KB |
n = 4297, m = 5 |
82 |
Correct |
5 ms |
10588 KB |
n = 4662, m = 48 |
83 |
Correct |
6 ms |
9752 KB |
n = 4753, m = 49 |
84 |
Correct |
5 ms |
8976 KB |
n = 4148, m = 46 |
85 |
Correct |
6 ms |
9564 KB |
n = 4906, m = 50 |
86 |
Correct |
6 ms |
10636 KB |
n = 4967, m = 50 |
87 |
Correct |
6 ms |
9564 KB |
n = 4828, m = 49 |
88 |
Correct |
5 ms |
9308 KB |
n = 4105, m = 45 |
89 |
Correct |
6 ms |
10844 KB |
n = 4954, m = 50 |
90 |
Correct |
6 ms |
13736 KB |
n = 4884, m = 49 |
91 |
Correct |
9 ms |
12380 KB |
n = 4307, m = 100 |
92 |
Correct |
10 ms |
13784 KB |
n = 4668, m = 100 |
93 |
Correct |
11 ms |
12636 KB |
n = 4647, m = 100 |
94 |
Correct |
9 ms |
13776 KB |
n = 4372, m = 100 |
95 |
Correct |
10 ms |
13604 KB |
n = 4791, m = 100 |
96 |
Correct |
9 ms |
12892 KB |
n = 4029, m = 100 |
97 |
Correct |
9 ms |
9564 KB |
n = 4439, m = 100 |
98 |
Correct |
9 ms |
13660 KB |
n = 4018, m = 100 |
99 |
Correct |
12 ms |
9564 KB |
n = 4979, m = 100 |
100 |
Correct |
10 ms |
13916 KB |
n = 4996, m = 89 |
101 |
Correct |
101 ms |
188392 KB |
n = 178952, m = 10 |
102 |
Correct |
91 ms |
174036 KB |
n = 180674, m = 10 |
103 |
Correct |
87 ms |
174416 KB |
n = 167639, m = 10 |
104 |
Correct |
82 ms |
173652 KB |
n = 172892, m = 10 |
105 |
Correct |
80 ms |
171348 KB |
n = 168125, m = 10 |
106 |
Correct |
81 ms |
171604 KB |
n = 166514, m = 10 |
107 |
Correct |
106 ms |
191480 KB |
n = 183874, m = 10 |
108 |
Correct |
96 ms |
202836 KB |
n = 194560, m = 10 |
109 |
Correct |
82 ms |
168164 KB |
n = 171994, m = 10 |
110 |
Correct |
353 ms |
179008 KB |
n = 165207, m = 100 |
111 |
Correct |
406 ms |
214100 KB |
n = 188459, m = 100 |
112 |
Correct |
364 ms |
205740 KB |
n = 162137, m = 100 |
113 |
Correct |
365 ms |
215068 KB |
n = 169691, m = 100 |
114 |
Correct |
432 ms |
228368 KB |
n = 187642, m = 100 |
115 |
Correct |
380 ms |
215348 KB |
n = 168456, m = 100 |
116 |
Correct |
364 ms |
188884 KB |
n = 180980, m = 100 |
117 |
Correct |
417 ms |
241488 KB |
n = 191687, m = 100 |
118 |
Correct |
373 ms |
211536 KB |
n = 166437, m = 100 |
119 |
Correct |
397 ms |
196236 KB |
n = 186520, m = 100 |
120 |
Correct |
378 ms |
207700 KB |
n = 166675, m = 100 |
121 |
Correct |
433 ms |
239796 KB |
n = 187725, m = 100 |
122 |
Correct |
373 ms |
203856 KB |
n = 161455, m = 100 |
123 |
Correct |
434 ms |
246248 KB |
n = 192977, m = 100 |
124 |
Correct |
440 ms |
245988 KB |
n = 192612, m = 100 |
125 |
Correct |
430 ms |
247888 KB |
n = 196512, m = 100 |
126 |
Correct |
461 ms |
250960 KB |
n = 198968, m = 100 |
127 |
Correct |
366 ms |
211708 KB |
n = 166659, m = 100 |
128 |
Correct |
220 ms |
253364 KB |
n = 199997, m = 34 |
129 |
Correct |
58 ms |
172260 KB |
n = 200000, m = 1 |
130 |
Correct |
84 ms |
253264 KB |
n = 200000, m = 1 |
131 |
Correct |
538 ms |
253336 KB |
n = 199999, m = 100 |
132 |
Correct |
514 ms |
253268 KB |
n = 199999, m = 100 |
133 |
Correct |
31 ms |
92396 KB |
n = 200000, m = 1 |