#include <bits/stdc++.h>
#include "paint.h"
#warning That's not FB, that's my FB
using namespace std;
using integer = int;
#define int long long
int modulo = (int)1e18 + 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(0ll,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 |
8536 KB |
n = 13, m = 1 |
2 |
Correct |
1 ms |
8540 KB |
n = 18, m = 1 |
3 |
Correct |
1 ms |
8548 KB |
n = 17, m = 1 |
4 |
Correct |
2 ms |
10588 KB |
n = 1, m = 1 |
5 |
Correct |
1 ms |
8540 KB |
n = 20, m = 1 |
6 |
Correct |
1 ms |
8540 KB |
n = 20, m = 1 |
7 |
Correct |
1 ms |
8536 KB |
n = 20, m = 1 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8536 KB |
n = 13, m = 1 |
2 |
Correct |
1 ms |
8540 KB |
n = 18, m = 1 |
3 |
Correct |
1 ms |
8548 KB |
n = 17, m = 1 |
4 |
Correct |
2 ms |
10588 KB |
n = 1, m = 1 |
5 |
Correct |
1 ms |
8540 KB |
n = 20, m = 1 |
6 |
Correct |
1 ms |
8540 KB |
n = 20, m = 1 |
7 |
Correct |
1 ms |
8536 KB |
n = 20, m = 1 |
8 |
Correct |
2 ms |
10844 KB |
n = 20, m = 5 |
9 |
Correct |
1 ms |
8540 KB |
n = 18, m = 3 |
10 |
Correct |
1 ms |
8540 KB |
n = 17, m = 2 |
11 |
Correct |
1 ms |
8540 KB |
n = 20, m = 2 |
12 |
Correct |
1 ms |
8540 KB |
n = 17, m = 4 |
13 |
Correct |
1 ms |
10588 KB |
n = 17, m = 6 |
14 |
Correct |
1 ms |
8540 KB |
n = 17, m = 1 |
15 |
Correct |
1 ms |
8540 KB |
n = 17, m = 4 |
16 |
Correct |
1 ms |
8536 KB |
n = 13, m = 3 |
17 |
Correct |
1 ms |
8540 KB |
n = 18, m = 4 |
18 |
Correct |
1 ms |
10588 KB |
n = 20, m = 10 |
19 |
Correct |
1 ms |
8540 KB |
n = 19, m = 10 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8536 KB |
n = 13, m = 1 |
2 |
Correct |
1 ms |
8540 KB |
n = 18, m = 1 |
3 |
Correct |
1 ms |
8548 KB |
n = 17, m = 1 |
4 |
Correct |
2 ms |
10588 KB |
n = 1, m = 1 |
5 |
Correct |
1 ms |
8540 KB |
n = 20, m = 1 |
6 |
Correct |
1 ms |
8540 KB |
n = 20, m = 1 |
7 |
Correct |
1 ms |
8536 KB |
n = 20, m = 1 |
8 |
Correct |
2 ms |
10844 KB |
n = 20, m = 5 |
9 |
Correct |
1 ms |
8540 KB |
n = 18, m = 3 |
10 |
Correct |
1 ms |
8540 KB |
n = 17, m = 2 |
11 |
Correct |
1 ms |
8540 KB |
n = 20, m = 2 |
12 |
Correct |
1 ms |
8540 KB |
n = 17, m = 4 |
13 |
Correct |
1 ms |
10588 KB |
n = 17, m = 6 |
14 |
Correct |
1 ms |
8540 KB |
n = 17, m = 1 |
15 |
Correct |
1 ms |
8540 KB |
n = 17, m = 4 |
16 |
Correct |
1 ms |
8536 KB |
n = 13, m = 3 |
17 |
Correct |
1 ms |
8540 KB |
n = 18, m = 4 |
18 |
Correct |
1 ms |
10588 KB |
n = 20, m = 10 |
19 |
Correct |
1 ms |
8540 KB |
n = 19, m = 10 |
20 |
Correct |
1 ms |
10588 KB |
n = 100, m = 5 |
21 |
Correct |
1 ms |
8540 KB |
n = 90, m = 3 |
22 |
Correct |
1 ms |
10588 KB |
n = 86, m = 2 |
23 |
Correct |
1 ms |
8540 KB |
n = 81, m = 4 |
24 |
Correct |
1 ms |
10588 KB |
n = 89, m = 10 |
25 |
Correct |
1 ms |
8540 KB |
n = 81, m = 23 |
26 |
Correct |
1 ms |
10688 KB |
n = 86, m = 8 |
27 |
Correct |
1 ms |
10588 KB |
n = 53, m = 22 |
28 |
Correct |
1 ms |
12636 KB |
n = 89, m = 35 |
29 |
Correct |
1 ms |
10588 KB |
n = 63, m = 25 |
30 |
Correct |
2 ms |
12636 KB |
n = 100, m = 50 |
31 |
Correct |
1 ms |
12636 KB |
n = 99, m = 50 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8536 KB |
n = 13, m = 1 |
2 |
Correct |
1 ms |
8540 KB |
n = 18, m = 1 |
3 |
Correct |
1 ms |
8548 KB |
n = 17, m = 1 |
4 |
Correct |
2 ms |
10588 KB |
n = 1, m = 1 |
5 |
Correct |
1 ms |
8540 KB |
n = 20, m = 1 |
6 |
Correct |
1 ms |
8540 KB |
n = 20, m = 1 |
7 |
Correct |
1 ms |
8536 KB |
n = 20, m = 1 |
8 |
Correct |
2 ms |
10844 KB |
n = 20, m = 5 |
9 |
Correct |
1 ms |
8540 KB |
n = 18, m = 3 |
10 |
Correct |
1 ms |
8540 KB |
n = 17, m = 2 |
11 |
Correct |
1 ms |
8540 KB |
n = 20, m = 2 |
12 |
Correct |
1 ms |
8540 KB |
n = 17, m = 4 |
13 |
Correct |
1 ms |
10588 KB |
n = 17, m = 6 |
14 |
Correct |
1 ms |
8540 KB |
n = 17, m = 1 |
15 |
Correct |
1 ms |
8540 KB |
n = 17, m = 4 |
16 |
Correct |
1 ms |
8536 KB |
n = 13, m = 3 |
17 |
Correct |
1 ms |
8540 KB |
n = 18, m = 4 |
18 |
Correct |
1 ms |
10588 KB |
n = 20, m = 10 |
19 |
Correct |
1 ms |
8540 KB |
n = 19, m = 10 |
20 |
Correct |
1 ms |
10588 KB |
n = 100, m = 5 |
21 |
Correct |
1 ms |
8540 KB |
n = 90, m = 3 |
22 |
Correct |
1 ms |
10588 KB |
n = 86, m = 2 |
23 |
Correct |
1 ms |
8540 KB |
n = 81, m = 4 |
24 |
Correct |
1 ms |
10588 KB |
n = 89, m = 10 |
25 |
Correct |
1 ms |
8540 KB |
n = 81, m = 23 |
26 |
Correct |
1 ms |
10688 KB |
n = 86, m = 8 |
27 |
Correct |
1 ms |
10588 KB |
n = 53, m = 22 |
28 |
Correct |
1 ms |
12636 KB |
n = 89, m = 35 |
29 |
Correct |
1 ms |
10588 KB |
n = 63, m = 25 |
30 |
Correct |
2 ms |
12636 KB |
n = 100, m = 50 |
31 |
Correct |
1 ms |
12636 KB |
n = 99, m = 50 |
32 |
Correct |
1 ms |
8540 KB |
n = 13, m = 4 |
33 |
Correct |
1 ms |
10588 KB |
n = 86, m = 2 |
34 |
Correct |
1 ms |
10588 KB |
n = 88, m = 2 |
35 |
Correct |
1 ms |
10588 KB |
n = 86, m = 2 |
36 |
Correct |
1 ms |
8540 KB |
n = 81, m = 6 |
37 |
Correct |
1 ms |
10588 KB |
n = 98, m = 7 |
38 |
Correct |
1 ms |
10588 KB |
n = 92, m = 7 |
39 |
Correct |
2 ms |
12636 KB |
n = 88, m = 21 |
40 |
Correct |
1 ms |
8540 KB |
n = 90, m = 21 |
41 |
Correct |
1 ms |
10588 KB |
n = 98, m = 22 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8536 KB |
n = 13, m = 1 |
2 |
Correct |
1 ms |
8540 KB |
n = 18, m = 1 |
3 |
Correct |
1 ms |
8548 KB |
n = 17, m = 1 |
4 |
Correct |
2 ms |
10588 KB |
n = 1, m = 1 |
5 |
Correct |
1 ms |
8540 KB |
n = 20, m = 1 |
6 |
Correct |
1 ms |
8540 KB |
n = 20, m = 1 |
7 |
Correct |
1 ms |
8536 KB |
n = 20, m = 1 |
8 |
Correct |
2 ms |
10844 KB |
n = 20, m = 5 |
9 |
Correct |
1 ms |
8540 KB |
n = 18, m = 3 |
10 |
Correct |
1 ms |
8540 KB |
n = 17, m = 2 |
11 |
Correct |
1 ms |
8540 KB |
n = 20, m = 2 |
12 |
Correct |
1 ms |
8540 KB |
n = 17, m = 4 |
13 |
Correct |
1 ms |
10588 KB |
n = 17, m = 6 |
14 |
Correct |
1 ms |
8540 KB |
n = 17, m = 1 |
15 |
Correct |
1 ms |
8540 KB |
n = 17, m = 4 |
16 |
Correct |
1 ms |
8536 KB |
n = 13, m = 3 |
17 |
Correct |
1 ms |
8540 KB |
n = 18, m = 4 |
18 |
Correct |
1 ms |
10588 KB |
n = 20, m = 10 |
19 |
Correct |
1 ms |
8540 KB |
n = 19, m = 10 |
20 |
Correct |
1 ms |
10588 KB |
n = 100, m = 5 |
21 |
Correct |
1 ms |
8540 KB |
n = 90, m = 3 |
22 |
Correct |
1 ms |
10588 KB |
n = 86, m = 2 |
23 |
Correct |
1 ms |
8540 KB |
n = 81, m = 4 |
24 |
Correct |
1 ms |
10588 KB |
n = 89, m = 10 |
25 |
Correct |
1 ms |
8540 KB |
n = 81, m = 23 |
26 |
Correct |
1 ms |
10688 KB |
n = 86, m = 8 |
27 |
Correct |
1 ms |
10588 KB |
n = 53, m = 22 |
28 |
Correct |
1 ms |
12636 KB |
n = 89, m = 35 |
29 |
Correct |
1 ms |
10588 KB |
n = 63, m = 25 |
30 |
Correct |
2 ms |
12636 KB |
n = 100, m = 50 |
31 |
Correct |
1 ms |
12636 KB |
n = 99, m = 50 |
32 |
Correct |
1 ms |
8540 KB |
n = 13, m = 4 |
33 |
Correct |
1 ms |
10588 KB |
n = 86, m = 2 |
34 |
Correct |
1 ms |
10588 KB |
n = 88, m = 2 |
35 |
Correct |
1 ms |
10588 KB |
n = 86, m = 2 |
36 |
Correct |
1 ms |
8540 KB |
n = 81, m = 6 |
37 |
Correct |
1 ms |
10588 KB |
n = 98, m = 7 |
38 |
Correct |
1 ms |
10588 KB |
n = 92, m = 7 |
39 |
Correct |
2 ms |
12636 KB |
n = 88, m = 21 |
40 |
Correct |
1 ms |
8540 KB |
n = 90, m = 21 |
41 |
Correct |
1 ms |
10588 KB |
n = 98, m = 22 |
42 |
Correct |
1 ms |
8536 KB |
n = 11, m = 2 |
43 |
Correct |
1 ms |
8540 KB |
n = 11, m = 2 |
44 |
Correct |
1 ms |
8640 KB |
n = 13, m = 3 |
45 |
Correct |
2 ms |
10588 KB |
n = 86, m = 2 |
46 |
Correct |
1 ms |
8540 KB |
n = 81, m = 2 |
47 |
Correct |
1 ms |
10588 KB |
n = 93, m = 2 |
48 |
Correct |
1 ms |
8540 KB |
n = 81, m = 2 |
49 |
Correct |
1 ms |
10588 KB |
n = 86, m = 2 |
50 |
Correct |
1 ms |
8536 KB |
n = 90, m = 2 |
51 |
Correct |
1 ms |
8540 KB |
n = 87, m = 2 |
52 |
Correct |
1 ms |
10588 KB |
n = 97, m = 2 |
53 |
Correct |
1 ms |
8536 KB |
n = 85, m = 2 |
54 |
Correct |
1 ms |
10588 KB |
n = 88, m = 7 |
55 |
Correct |
1 ms |
8540 KB |
n = 96, m = 7 |
56 |
Correct |
1 ms |
8540 KB |
n = 85, m = 7 |
57 |
Correct |
2 ms |
8540 KB |
n = 92, m = 7 |
58 |
Correct |
1 ms |
10588 KB |
n = 92, m = 7 |
59 |
Correct |
1 ms |
4700 KB |
n = 86, m = 7 |
60 |
Correct |
1 ms |
4700 KB |
n = 87, m = 7 |
61 |
Correct |
1 ms |
4556 KB |
n = 100, m = 7 |
62 |
Correct |
1 ms |
2652 KB |
n = 100, m = 7 |
63 |
Correct |
1 ms |
8536 KB |
n = 92, m = 21 |
64 |
Correct |
1 ms |
6492 KB |
n = 93, m = 22 |
65 |
Correct |
1 ms |
4544 KB |
n = 95, m = 22 |
66 |
Correct |
1 ms |
2652 KB |
n = 98, m = 22 |
67 |
Correct |
1 ms |
4700 KB |
n = 94, m = 22 |
68 |
Correct |
1 ms |
10588 KB |
n = 93, m = 22 |
69 |
Correct |
1 ms |
8540 KB |
n = 88, m = 21 |
70 |
Correct |
1 ms |
8540 KB |
n = 83, m = 20 |
71 |
Correct |
1 ms |
10588 KB |
n = 99, m = 23 |
72 |
Correct |
1 ms |
10588 KB |
n = 96, m = 19 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8536 KB |
n = 13, m = 1 |
2 |
Correct |
1 ms |
8540 KB |
n = 18, m = 1 |
3 |
Correct |
1 ms |
8548 KB |
n = 17, m = 1 |
4 |
Correct |
2 ms |
10588 KB |
n = 1, m = 1 |
5 |
Correct |
1 ms |
8540 KB |
n = 20, m = 1 |
6 |
Correct |
1 ms |
8540 KB |
n = 20, m = 1 |
7 |
Correct |
1 ms |
8536 KB |
n = 20, m = 1 |
8 |
Correct |
2 ms |
10844 KB |
n = 20, m = 5 |
9 |
Correct |
1 ms |
8540 KB |
n = 18, m = 3 |
10 |
Correct |
1 ms |
8540 KB |
n = 17, m = 2 |
11 |
Correct |
1 ms |
8540 KB |
n = 20, m = 2 |
12 |
Correct |
1 ms |
8540 KB |
n = 17, m = 4 |
13 |
Correct |
1 ms |
10588 KB |
n = 17, m = 6 |
14 |
Correct |
1 ms |
8540 KB |
n = 17, m = 1 |
15 |
Correct |
1 ms |
8540 KB |
n = 17, m = 4 |
16 |
Correct |
1 ms |
8536 KB |
n = 13, m = 3 |
17 |
Correct |
1 ms |
8540 KB |
n = 18, m = 4 |
18 |
Correct |
1 ms |
10588 KB |
n = 20, m = 10 |
19 |
Correct |
1 ms |
8540 KB |
n = 19, m = 10 |
20 |
Correct |
1 ms |
10588 KB |
n = 100, m = 5 |
21 |
Correct |
1 ms |
8540 KB |
n = 90, m = 3 |
22 |
Correct |
1 ms |
10588 KB |
n = 86, m = 2 |
23 |
Correct |
1 ms |
8540 KB |
n = 81, m = 4 |
24 |
Correct |
1 ms |
10588 KB |
n = 89, m = 10 |
25 |
Correct |
1 ms |
8540 KB |
n = 81, m = 23 |
26 |
Correct |
1 ms |
10688 KB |
n = 86, m = 8 |
27 |
Correct |
1 ms |
10588 KB |
n = 53, m = 22 |
28 |
Correct |
1 ms |
12636 KB |
n = 89, m = 35 |
29 |
Correct |
1 ms |
10588 KB |
n = 63, m = 25 |
30 |
Correct |
2 ms |
12636 KB |
n = 100, m = 50 |
31 |
Correct |
1 ms |
12636 KB |
n = 99, m = 50 |
32 |
Correct |
1 ms |
8540 KB |
n = 13, m = 4 |
33 |
Correct |
1 ms |
10588 KB |
n = 86, m = 2 |
34 |
Correct |
1 ms |
10588 KB |
n = 88, m = 2 |
35 |
Correct |
1 ms |
10588 KB |
n = 86, m = 2 |
36 |
Correct |
1 ms |
8540 KB |
n = 81, m = 6 |
37 |
Correct |
1 ms |
10588 KB |
n = 98, m = 7 |
38 |
Correct |
1 ms |
10588 KB |
n = 92, m = 7 |
39 |
Correct |
2 ms |
12636 KB |
n = 88, m = 21 |
40 |
Correct |
1 ms |
8540 KB |
n = 90, m = 21 |
41 |
Correct |
1 ms |
10588 KB |
n = 98, m = 22 |
42 |
Correct |
1 ms |
8536 KB |
n = 11, m = 2 |
43 |
Correct |
1 ms |
8540 KB |
n = 11, m = 2 |
44 |
Correct |
1 ms |
8640 KB |
n = 13, m = 3 |
45 |
Correct |
2 ms |
10588 KB |
n = 86, m = 2 |
46 |
Correct |
1 ms |
8540 KB |
n = 81, m = 2 |
47 |
Correct |
1 ms |
10588 KB |
n = 93, m = 2 |
48 |
Correct |
1 ms |
8540 KB |
n = 81, m = 2 |
49 |
Correct |
1 ms |
10588 KB |
n = 86, m = 2 |
50 |
Correct |
1 ms |
8536 KB |
n = 90, m = 2 |
51 |
Correct |
1 ms |
8540 KB |
n = 87, m = 2 |
52 |
Correct |
1 ms |
10588 KB |
n = 97, m = 2 |
53 |
Correct |
1 ms |
8536 KB |
n = 85, m = 2 |
54 |
Correct |
1 ms |
10588 KB |
n = 88, m = 7 |
55 |
Correct |
1 ms |
8540 KB |
n = 96, m = 7 |
56 |
Correct |
1 ms |
8540 KB |
n = 85, m = 7 |
57 |
Correct |
2 ms |
8540 KB |
n = 92, m = 7 |
58 |
Correct |
1 ms |
10588 KB |
n = 92, m = 7 |
59 |
Correct |
1 ms |
4700 KB |
n = 86, m = 7 |
60 |
Correct |
1 ms |
4700 KB |
n = 87, m = 7 |
61 |
Correct |
1 ms |
4556 KB |
n = 100, m = 7 |
62 |
Correct |
1 ms |
2652 KB |
n = 100, m = 7 |
63 |
Correct |
1 ms |
8536 KB |
n = 92, m = 21 |
64 |
Correct |
1 ms |
6492 KB |
n = 93, m = 22 |
65 |
Correct |
1 ms |
4544 KB |
n = 95, m = 22 |
66 |
Correct |
1 ms |
2652 KB |
n = 98, m = 22 |
67 |
Correct |
1 ms |
4700 KB |
n = 94, m = 22 |
68 |
Correct |
1 ms |
10588 KB |
n = 93, m = 22 |
69 |
Correct |
1 ms |
8540 KB |
n = 88, m = 21 |
70 |
Correct |
1 ms |
8540 KB |
n = 83, m = 20 |
71 |
Correct |
1 ms |
10588 KB |
n = 99, m = 23 |
72 |
Correct |
1 ms |
10588 KB |
n = 96, m = 19 |
73 |
Correct |
4 ms |
16732 KB |
n = 4825, m = 5 |
74 |
Correct |
3 ms |
12464 KB |
n = 4384, m = 5 |
75 |
Correct |
3 ms |
15960 KB |
n = 4528, m = 5 |
76 |
Correct |
3 ms |
16220 KB |
n = 4980, m = 5 |
77 |
Correct |
3 ms |
16220 KB |
n = 4730, m = 5 |
78 |
Correct |
2 ms |
13916 KB |
n = 4784, m = 5 |
79 |
Correct |
5 ms |
16476 KB |
n = 4875, m = 5 |
80 |
Correct |
2 ms |
14172 KB |
n = 4576, m = 5 |
81 |
Correct |
3 ms |
17756 KB |
n = 4297, m = 5 |
82 |
Correct |
6 ms |
16220 KB |
n = 4662, m = 48 |
83 |
Correct |
7 ms |
16728 KB |
n = 4753, m = 49 |
84 |
Correct |
6 ms |
15704 KB |
n = 4148, m = 46 |
85 |
Correct |
7 ms |
18264 KB |
n = 4906, m = 50 |
86 |
Correct |
8 ms |
19016 KB |
n = 4967, m = 50 |
87 |
Correct |
7 ms |
18776 KB |
n = 4828, m = 49 |
88 |
Correct |
6 ms |
16220 KB |
n = 4105, m = 45 |
89 |
Correct |
8 ms |
18780 KB |
n = 4954, m = 50 |
90 |
Correct |
8 ms |
18776 KB |
n = 4884, m = 49 |
91 |
Correct |
11 ms |
18268 KB |
n = 4307, m = 100 |
92 |
Correct |
12 ms |
18520 KB |
n = 4668, m = 100 |
93 |
Correct |
12 ms |
18524 KB |
n = 4647, m = 100 |
94 |
Correct |
11 ms |
16532 KB |
n = 4372, m = 100 |
95 |
Correct |
11 ms |
16732 KB |
n = 4791, m = 100 |
96 |
Correct |
10 ms |
15768 KB |
n = 4029, m = 100 |
97 |
Correct |
10 ms |
16476 KB |
n = 4439, m = 100 |
98 |
Correct |
9 ms |
15708 KB |
n = 4018, m = 100 |
99 |
Correct |
12 ms |
19036 KB |
n = 4979, m = 100 |
100 |
Correct |
12 ms |
19292 KB |
n = 4996, m = 89 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8536 KB |
n = 13, m = 1 |
2 |
Correct |
1 ms |
8540 KB |
n = 18, m = 1 |
3 |
Correct |
1 ms |
8548 KB |
n = 17, m = 1 |
4 |
Correct |
2 ms |
10588 KB |
n = 1, m = 1 |
5 |
Correct |
1 ms |
8540 KB |
n = 20, m = 1 |
6 |
Correct |
1 ms |
8540 KB |
n = 20, m = 1 |
7 |
Correct |
1 ms |
8536 KB |
n = 20, m = 1 |
8 |
Correct |
2 ms |
10844 KB |
n = 20, m = 5 |
9 |
Correct |
1 ms |
8540 KB |
n = 18, m = 3 |
10 |
Correct |
1 ms |
8540 KB |
n = 17, m = 2 |
11 |
Correct |
1 ms |
8540 KB |
n = 20, m = 2 |
12 |
Correct |
1 ms |
8540 KB |
n = 17, m = 4 |
13 |
Correct |
1 ms |
10588 KB |
n = 17, m = 6 |
14 |
Correct |
1 ms |
8540 KB |
n = 17, m = 1 |
15 |
Correct |
1 ms |
8540 KB |
n = 17, m = 4 |
16 |
Correct |
1 ms |
8536 KB |
n = 13, m = 3 |
17 |
Correct |
1 ms |
8540 KB |
n = 18, m = 4 |
18 |
Correct |
1 ms |
10588 KB |
n = 20, m = 10 |
19 |
Correct |
1 ms |
8540 KB |
n = 19, m = 10 |
20 |
Correct |
1 ms |
10588 KB |
n = 100, m = 5 |
21 |
Correct |
1 ms |
8540 KB |
n = 90, m = 3 |
22 |
Correct |
1 ms |
10588 KB |
n = 86, m = 2 |
23 |
Correct |
1 ms |
8540 KB |
n = 81, m = 4 |
24 |
Correct |
1 ms |
10588 KB |
n = 89, m = 10 |
25 |
Correct |
1 ms |
8540 KB |
n = 81, m = 23 |
26 |
Correct |
1 ms |
10688 KB |
n = 86, m = 8 |
27 |
Correct |
1 ms |
10588 KB |
n = 53, m = 22 |
28 |
Correct |
1 ms |
12636 KB |
n = 89, m = 35 |
29 |
Correct |
1 ms |
10588 KB |
n = 63, m = 25 |
30 |
Correct |
2 ms |
12636 KB |
n = 100, m = 50 |
31 |
Correct |
1 ms |
12636 KB |
n = 99, m = 50 |
32 |
Correct |
1 ms |
8540 KB |
n = 13, m = 4 |
33 |
Correct |
1 ms |
10588 KB |
n = 86, m = 2 |
34 |
Correct |
1 ms |
10588 KB |
n = 88, m = 2 |
35 |
Correct |
1 ms |
10588 KB |
n = 86, m = 2 |
36 |
Correct |
1 ms |
8540 KB |
n = 81, m = 6 |
37 |
Correct |
1 ms |
10588 KB |
n = 98, m = 7 |
38 |
Correct |
1 ms |
10588 KB |
n = 92, m = 7 |
39 |
Correct |
2 ms |
12636 KB |
n = 88, m = 21 |
40 |
Correct |
1 ms |
8540 KB |
n = 90, m = 21 |
41 |
Correct |
1 ms |
10588 KB |
n = 98, m = 22 |
42 |
Correct |
1 ms |
8536 KB |
n = 11, m = 2 |
43 |
Correct |
1 ms |
8540 KB |
n = 11, m = 2 |
44 |
Correct |
1 ms |
8640 KB |
n = 13, m = 3 |
45 |
Correct |
2 ms |
10588 KB |
n = 86, m = 2 |
46 |
Correct |
1 ms |
8540 KB |
n = 81, m = 2 |
47 |
Correct |
1 ms |
10588 KB |
n = 93, m = 2 |
48 |
Correct |
1 ms |
8540 KB |
n = 81, m = 2 |
49 |
Correct |
1 ms |
10588 KB |
n = 86, m = 2 |
50 |
Correct |
1 ms |
8536 KB |
n = 90, m = 2 |
51 |
Correct |
1 ms |
8540 KB |
n = 87, m = 2 |
52 |
Correct |
1 ms |
10588 KB |
n = 97, m = 2 |
53 |
Correct |
1 ms |
8536 KB |
n = 85, m = 2 |
54 |
Correct |
1 ms |
10588 KB |
n = 88, m = 7 |
55 |
Correct |
1 ms |
8540 KB |
n = 96, m = 7 |
56 |
Correct |
1 ms |
8540 KB |
n = 85, m = 7 |
57 |
Correct |
2 ms |
8540 KB |
n = 92, m = 7 |
58 |
Correct |
1 ms |
10588 KB |
n = 92, m = 7 |
59 |
Correct |
1 ms |
4700 KB |
n = 86, m = 7 |
60 |
Correct |
1 ms |
4700 KB |
n = 87, m = 7 |
61 |
Correct |
1 ms |
4556 KB |
n = 100, m = 7 |
62 |
Correct |
1 ms |
2652 KB |
n = 100, m = 7 |
63 |
Correct |
1 ms |
8536 KB |
n = 92, m = 21 |
64 |
Correct |
1 ms |
6492 KB |
n = 93, m = 22 |
65 |
Correct |
1 ms |
4544 KB |
n = 95, m = 22 |
66 |
Correct |
1 ms |
2652 KB |
n = 98, m = 22 |
67 |
Correct |
1 ms |
4700 KB |
n = 94, m = 22 |
68 |
Correct |
1 ms |
10588 KB |
n = 93, m = 22 |
69 |
Correct |
1 ms |
8540 KB |
n = 88, m = 21 |
70 |
Correct |
1 ms |
8540 KB |
n = 83, m = 20 |
71 |
Correct |
1 ms |
10588 KB |
n = 99, m = 23 |
72 |
Correct |
1 ms |
10588 KB |
n = 96, m = 19 |
73 |
Correct |
4 ms |
16732 KB |
n = 4825, m = 5 |
74 |
Correct |
3 ms |
12464 KB |
n = 4384, m = 5 |
75 |
Correct |
3 ms |
15960 KB |
n = 4528, m = 5 |
76 |
Correct |
3 ms |
16220 KB |
n = 4980, m = 5 |
77 |
Correct |
3 ms |
16220 KB |
n = 4730, m = 5 |
78 |
Correct |
2 ms |
13916 KB |
n = 4784, m = 5 |
79 |
Correct |
5 ms |
16476 KB |
n = 4875, m = 5 |
80 |
Correct |
2 ms |
14172 KB |
n = 4576, m = 5 |
81 |
Correct |
3 ms |
17756 KB |
n = 4297, m = 5 |
82 |
Correct |
6 ms |
16220 KB |
n = 4662, m = 48 |
83 |
Correct |
7 ms |
16728 KB |
n = 4753, m = 49 |
84 |
Correct |
6 ms |
15704 KB |
n = 4148, m = 46 |
85 |
Correct |
7 ms |
18264 KB |
n = 4906, m = 50 |
86 |
Correct |
8 ms |
19016 KB |
n = 4967, m = 50 |
87 |
Correct |
7 ms |
18776 KB |
n = 4828, m = 49 |
88 |
Correct |
6 ms |
16220 KB |
n = 4105, m = 45 |
89 |
Correct |
8 ms |
18780 KB |
n = 4954, m = 50 |
90 |
Correct |
8 ms |
18776 KB |
n = 4884, m = 49 |
91 |
Correct |
11 ms |
18268 KB |
n = 4307, m = 100 |
92 |
Correct |
12 ms |
18520 KB |
n = 4668, m = 100 |
93 |
Correct |
12 ms |
18524 KB |
n = 4647, m = 100 |
94 |
Correct |
11 ms |
16532 KB |
n = 4372, m = 100 |
95 |
Correct |
11 ms |
16732 KB |
n = 4791, m = 100 |
96 |
Correct |
10 ms |
15768 KB |
n = 4029, m = 100 |
97 |
Correct |
10 ms |
16476 KB |
n = 4439, m = 100 |
98 |
Correct |
9 ms |
15708 KB |
n = 4018, m = 100 |
99 |
Correct |
12 ms |
19036 KB |
n = 4979, m = 100 |
100 |
Correct |
12 ms |
19292 KB |
n = 4996, m = 89 |
101 |
Correct |
161 ms |
372820 KB |
n = 178952, m = 10 |
102 |
Correct |
137 ms |
346564 KB |
n = 180674, m = 10 |
103 |
Correct |
143 ms |
345088 KB |
n = 167639, m = 10 |
104 |
Correct |
139 ms |
344540 KB |
n = 172892, m = 10 |
105 |
Correct |
150 ms |
340016 KB |
n = 168125, m = 10 |
106 |
Correct |
133 ms |
342356 KB |
n = 166514, m = 10 |
107 |
Correct |
157 ms |
379876 KB |
n = 183874, m = 10 |
108 |
Correct |
174 ms |
404640 KB |
n = 194560, m = 10 |
109 |
Correct |
134 ms |
335332 KB |
n = 171994, m = 10 |
110 |
Correct |
437 ms |
356096 KB |
n = 165207, m = 100 |
111 |
Correct |
513 ms |
417000 KB |
n = 188459, m = 100 |
112 |
Correct |
470 ms |
410192 KB |
n = 162137, m = 100 |
113 |
Correct |
449 ms |
417876 KB |
n = 169691, m = 100 |
114 |
Correct |
484 ms |
438100 KB |
n = 187642, m = 100 |
115 |
Correct |
459 ms |
427856 KB |
n = 168456, m = 100 |
116 |
Correct |
450 ms |
376152 KB |
n = 180980, m = 100 |
117 |
Correct |
501 ms |
470044 KB |
n = 191687, m = 100 |
118 |
Correct |
440 ms |
422220 KB |
n = 166437, m = 100 |
119 |
Correct |
477 ms |
389460 KB |
n = 186520, m = 100 |
120 |
Correct |
473 ms |
402260 KB |
n = 166675, m = 100 |
121 |
Correct |
522 ms |
475868 KB |
n = 187725, m = 100 |
122 |
Correct |
439 ms |
396020 KB |
n = 161455, m = 100 |
123 |
Correct |
538 ms |
486540 KB |
n = 192977, m = 100 |
124 |
Correct |
550 ms |
486356 KB |
n = 192612, m = 100 |
125 |
Correct |
537 ms |
483408 KB |
n = 196512, m = 100 |
126 |
Correct |
562 ms |
489620 KB |
n = 198968, m = 100 |
127 |
Correct |
458 ms |
421012 KB |
n = 166659, m = 100 |
128 |
Correct |
325 ms |
505680 KB |
n = 199997, m = 34 |
129 |
Correct |
99 ms |
343228 KB |
n = 200000, m = 1 |
130 |
Correct |
145 ms |
505680 KB |
n = 200000, m = 1 |
131 |
Correct |
513 ms |
505620 KB |
n = 199999, m = 100 |
132 |
Correct |
534 ms |
505680 KB |
n = 199999, m = 100 |
133 |
Correct |
61 ms |
181440 KB |
n = 200000, m = 1 |