#include "paint.h"
#include <bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define pii pair<ll, ll>
const ll mod = 1e9 + 7;
const ll mxN = 3e5 + 2;
using namespace std;
bool dpP[200010][110][2], dpS[200010][110][2];
int prfx[200010], suff[200010];
int a[200010], b[200010];
string solve_puzzle(string s, vector<int> c)
{
int n = s.size(), k = c.size();
string s1 = "#";
s1 += s;
s = s1;
vector<int> c1;
c1.push_back(-1);
for (auto x : c)
c1.push_back(x);
c = c1;
for (int i = 1; i <= n; i++)
{
prfx[i] = prfx[i - 1] + (s[i] == '_');
}
dpP[0][0][0] = 1;
dpS[n + 1][k + 1][0] = 1;
dpS[n + 2][k + 1][0] = 1;
for (int j = 0; j <= k; j++)
{
for (int i = 1; i <= n; i++)
{
if (s[i] != 'X')
{
dpP[i][j][0] = dpP[i - 1][j][0];
}
if (s[i] != '_' && j)
{
if (i >= c[j])
{
if (prfx[i] == prfx[i - c[j]])
{
if (j == 1)
dpP[i][j][1] = dpP[i - c[j]][j - 1][0];
else if (i > c[j] && s[i - c[j]] != 'X')
dpP[i][j][1] = dpP[i - c[j] - 1][j - 1][0];
}
}
}
dpP[i][j][0] = max(dpP[i][j][0], dpP[i][j][1]);
// cout << dpP[i][j][0] << ' ';
}
// cout << '\n';
}
// cout<<'\n';
for (int i = n; i; i--)
{
suff[i] = suff[i + 1] + (s[i] == '_');
}
for (int j = k + 1; j; j--)
{
for (int i = n; i; i--)
{
if (s[i] != 'X')
{
dpS[i][j][0] = dpS[i + 1][j][0];
}
if (s[i] != '_' && j != k + 1)
{
if (n - i + 1 >= c[j])
{
if (suff[i] == suff[i + c[j]])
{
if (j == k)
dpS[i][j][1] = dpS[i + c[j]][j + 1][0];
else if (s[i + c[j]] != 'X')
dpS[i][j][1] = dpS[i + c[j] + 1][j + 1][0];
// cout<<i<<' '<<j<<' '<<dpS[i][j][1]<<'\n';
}
}
}
dpS[i][j][0] = max(dpS[i][j][0], dpS[i][j][1]);
// cout << dpS[i][j][1] << ' ';
}
// cout<<'\n';
}
// cout<<'\n';
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= k + 1; j++)
{
if (j != k + 1 && ((dpP[i][j][1] && dpS[i + 2][j + 1][0]) && (i == n || s[i + 1] != 'X')))
{
a[i - c[j] + 1] += 1;
a[i + 1] += -1;
}
if (i == 1 && (j != k + 1 && ((dpP[i - 1][j - 1][0] && dpS[i][j][1]) && (i == 1 || s[i - 1] != 'X'))))
{
a[i] += 1;
a[i + c[j]] += -1;
}
else if (j != k + 1 && ((dpP[i - 2][j - 1][0] && dpS[i][j][1]) && (i == 1 || s[i - 1] != 'X')))
{
// cout<<i<<' '<<j<<' '<<dpS[i][j][1]<<'\n';
a[i] += 1;
a[i + c[j]] += -1;
}
if (dpP[i - 1][j - 1][0] && dpS[i + 1][j][0])
b[i] = 1;
}
}
// cout<<a[4]<<'\n';
for (int i = 1; i <= n; i++)
{
a[i] += a[i - 1];
// cout<<a[i]<<' ';
}
// cout<<'\n';
string ans;
for (int i = 1; i <= n; i++)
{
char ch;
if (s[i] != '.')
{
ans += s[i];
continue;
}
if (a[i] && b[i])
ch = '?';
else if (a[i])
ch = 'X';
else if (b[i])
ch = '_';
ans += ch;
}
// cout<<ans<<' '<<"TEST";
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2392 KB |
n = 13, m = 1 |
2 |
Correct |
1 ms |
2396 KB |
n = 18, m = 1 |
3 |
Correct |
1 ms |
2396 KB |
n = 17, m = 1 |
4 |
Correct |
1 ms |
2396 KB |
n = 1, m = 1 |
5 |
Correct |
1 ms |
2496 KB |
n = 20, m = 1 |
6 |
Correct |
1 ms |
2396 KB |
n = 20, m = 1 |
7 |
Correct |
1 ms |
2396 KB |
n = 20, m = 1 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2392 KB |
n = 13, m = 1 |
2 |
Correct |
1 ms |
2396 KB |
n = 18, m = 1 |
3 |
Correct |
1 ms |
2396 KB |
n = 17, m = 1 |
4 |
Correct |
1 ms |
2396 KB |
n = 1, m = 1 |
5 |
Correct |
1 ms |
2496 KB |
n = 20, m = 1 |
6 |
Correct |
1 ms |
2396 KB |
n = 20, m = 1 |
7 |
Correct |
1 ms |
2396 KB |
n = 20, m = 1 |
8 |
Correct |
1 ms |
2396 KB |
n = 20, m = 5 |
9 |
Correct |
1 ms |
2396 KB |
n = 18, m = 3 |
10 |
Correct |
1 ms |
2396 KB |
n = 17, m = 2 |
11 |
Correct |
1 ms |
2396 KB |
n = 20, m = 2 |
12 |
Correct |
1 ms |
2392 KB |
n = 17, m = 4 |
13 |
Correct |
1 ms |
2396 KB |
n = 17, m = 6 |
14 |
Correct |
1 ms |
2396 KB |
n = 17, m = 1 |
15 |
Correct |
1 ms |
2396 KB |
n = 17, m = 4 |
16 |
Correct |
1 ms |
2396 KB |
n = 13, m = 3 |
17 |
Correct |
1 ms |
2396 KB |
n = 18, m = 4 |
18 |
Correct |
1 ms |
2396 KB |
n = 20, m = 10 |
19 |
Correct |
1 ms |
2396 KB |
n = 19, m = 10 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2392 KB |
n = 13, m = 1 |
2 |
Correct |
1 ms |
2396 KB |
n = 18, m = 1 |
3 |
Correct |
1 ms |
2396 KB |
n = 17, m = 1 |
4 |
Correct |
1 ms |
2396 KB |
n = 1, m = 1 |
5 |
Correct |
1 ms |
2496 KB |
n = 20, m = 1 |
6 |
Correct |
1 ms |
2396 KB |
n = 20, m = 1 |
7 |
Correct |
1 ms |
2396 KB |
n = 20, m = 1 |
8 |
Correct |
1 ms |
2396 KB |
n = 20, m = 5 |
9 |
Correct |
1 ms |
2396 KB |
n = 18, m = 3 |
10 |
Correct |
1 ms |
2396 KB |
n = 17, m = 2 |
11 |
Correct |
1 ms |
2396 KB |
n = 20, m = 2 |
12 |
Correct |
1 ms |
2392 KB |
n = 17, m = 4 |
13 |
Correct |
1 ms |
2396 KB |
n = 17, m = 6 |
14 |
Correct |
1 ms |
2396 KB |
n = 17, m = 1 |
15 |
Correct |
1 ms |
2396 KB |
n = 17, m = 4 |
16 |
Correct |
1 ms |
2396 KB |
n = 13, m = 3 |
17 |
Correct |
1 ms |
2396 KB |
n = 18, m = 4 |
18 |
Correct |
1 ms |
2396 KB |
n = 20, m = 10 |
19 |
Correct |
1 ms |
2396 KB |
n = 19, m = 10 |
20 |
Correct |
1 ms |
2396 KB |
n = 100, m = 5 |
21 |
Correct |
1 ms |
2396 KB |
n = 90, m = 3 |
22 |
Correct |
1 ms |
2396 KB |
n = 86, m = 2 |
23 |
Correct |
1 ms |
2652 KB |
n = 81, m = 4 |
24 |
Correct |
1 ms |
2392 KB |
n = 89, m = 10 |
25 |
Correct |
1 ms |
2396 KB |
n = 81, m = 23 |
26 |
Correct |
1 ms |
2396 KB |
n = 86, m = 8 |
27 |
Correct |
1 ms |
2396 KB |
n = 53, m = 22 |
28 |
Correct |
1 ms |
2396 KB |
n = 89, m = 35 |
29 |
Correct |
1 ms |
2396 KB |
n = 63, m = 25 |
30 |
Correct |
1 ms |
2396 KB |
n = 100, m = 50 |
31 |
Correct |
1 ms |
2396 KB |
n = 99, m = 50 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2392 KB |
n = 13, m = 1 |
2 |
Correct |
1 ms |
2396 KB |
n = 18, m = 1 |
3 |
Correct |
1 ms |
2396 KB |
n = 17, m = 1 |
4 |
Correct |
1 ms |
2396 KB |
n = 1, m = 1 |
5 |
Correct |
1 ms |
2496 KB |
n = 20, m = 1 |
6 |
Correct |
1 ms |
2396 KB |
n = 20, m = 1 |
7 |
Correct |
1 ms |
2396 KB |
n = 20, m = 1 |
8 |
Correct |
1 ms |
2396 KB |
n = 20, m = 5 |
9 |
Correct |
1 ms |
2396 KB |
n = 18, m = 3 |
10 |
Correct |
1 ms |
2396 KB |
n = 17, m = 2 |
11 |
Correct |
1 ms |
2396 KB |
n = 20, m = 2 |
12 |
Correct |
1 ms |
2392 KB |
n = 17, m = 4 |
13 |
Correct |
1 ms |
2396 KB |
n = 17, m = 6 |
14 |
Correct |
1 ms |
2396 KB |
n = 17, m = 1 |
15 |
Correct |
1 ms |
2396 KB |
n = 17, m = 4 |
16 |
Correct |
1 ms |
2396 KB |
n = 13, m = 3 |
17 |
Correct |
1 ms |
2396 KB |
n = 18, m = 4 |
18 |
Correct |
1 ms |
2396 KB |
n = 20, m = 10 |
19 |
Correct |
1 ms |
2396 KB |
n = 19, m = 10 |
20 |
Correct |
1 ms |
2396 KB |
n = 100, m = 5 |
21 |
Correct |
1 ms |
2396 KB |
n = 90, m = 3 |
22 |
Correct |
1 ms |
2396 KB |
n = 86, m = 2 |
23 |
Correct |
1 ms |
2652 KB |
n = 81, m = 4 |
24 |
Correct |
1 ms |
2392 KB |
n = 89, m = 10 |
25 |
Correct |
1 ms |
2396 KB |
n = 81, m = 23 |
26 |
Correct |
1 ms |
2396 KB |
n = 86, m = 8 |
27 |
Correct |
1 ms |
2396 KB |
n = 53, m = 22 |
28 |
Correct |
1 ms |
2396 KB |
n = 89, m = 35 |
29 |
Correct |
1 ms |
2396 KB |
n = 63, m = 25 |
30 |
Correct |
1 ms |
2396 KB |
n = 100, m = 50 |
31 |
Correct |
1 ms |
2396 KB |
n = 99, m = 50 |
32 |
Correct |
1 ms |
2392 KB |
n = 13, m = 4 |
33 |
Correct |
1 ms |
2396 KB |
n = 86, m = 2 |
34 |
Correct |
1 ms |
2396 KB |
n = 88, m = 2 |
35 |
Correct |
1 ms |
2392 KB |
n = 86, m = 2 |
36 |
Correct |
1 ms |
2396 KB |
n = 81, m = 6 |
37 |
Correct |
1 ms |
2396 KB |
n = 98, m = 7 |
38 |
Correct |
1 ms |
2396 KB |
n = 92, m = 7 |
39 |
Correct |
1 ms |
2396 KB |
n = 88, m = 21 |
40 |
Correct |
1 ms |
2396 KB |
n = 90, m = 21 |
41 |
Correct |
1 ms |
2396 KB |
n = 98, m = 22 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2392 KB |
n = 13, m = 1 |
2 |
Correct |
1 ms |
2396 KB |
n = 18, m = 1 |
3 |
Correct |
1 ms |
2396 KB |
n = 17, m = 1 |
4 |
Correct |
1 ms |
2396 KB |
n = 1, m = 1 |
5 |
Correct |
1 ms |
2496 KB |
n = 20, m = 1 |
6 |
Correct |
1 ms |
2396 KB |
n = 20, m = 1 |
7 |
Correct |
1 ms |
2396 KB |
n = 20, m = 1 |
8 |
Correct |
1 ms |
2396 KB |
n = 20, m = 5 |
9 |
Correct |
1 ms |
2396 KB |
n = 18, m = 3 |
10 |
Correct |
1 ms |
2396 KB |
n = 17, m = 2 |
11 |
Correct |
1 ms |
2396 KB |
n = 20, m = 2 |
12 |
Correct |
1 ms |
2392 KB |
n = 17, m = 4 |
13 |
Correct |
1 ms |
2396 KB |
n = 17, m = 6 |
14 |
Correct |
1 ms |
2396 KB |
n = 17, m = 1 |
15 |
Correct |
1 ms |
2396 KB |
n = 17, m = 4 |
16 |
Correct |
1 ms |
2396 KB |
n = 13, m = 3 |
17 |
Correct |
1 ms |
2396 KB |
n = 18, m = 4 |
18 |
Correct |
1 ms |
2396 KB |
n = 20, m = 10 |
19 |
Correct |
1 ms |
2396 KB |
n = 19, m = 10 |
20 |
Correct |
1 ms |
2396 KB |
n = 100, m = 5 |
21 |
Correct |
1 ms |
2396 KB |
n = 90, m = 3 |
22 |
Correct |
1 ms |
2396 KB |
n = 86, m = 2 |
23 |
Correct |
1 ms |
2652 KB |
n = 81, m = 4 |
24 |
Correct |
1 ms |
2392 KB |
n = 89, m = 10 |
25 |
Correct |
1 ms |
2396 KB |
n = 81, m = 23 |
26 |
Correct |
1 ms |
2396 KB |
n = 86, m = 8 |
27 |
Correct |
1 ms |
2396 KB |
n = 53, m = 22 |
28 |
Correct |
1 ms |
2396 KB |
n = 89, m = 35 |
29 |
Correct |
1 ms |
2396 KB |
n = 63, m = 25 |
30 |
Correct |
1 ms |
2396 KB |
n = 100, m = 50 |
31 |
Correct |
1 ms |
2396 KB |
n = 99, m = 50 |
32 |
Correct |
1 ms |
2392 KB |
n = 13, m = 4 |
33 |
Correct |
1 ms |
2396 KB |
n = 86, m = 2 |
34 |
Correct |
1 ms |
2396 KB |
n = 88, m = 2 |
35 |
Correct |
1 ms |
2392 KB |
n = 86, m = 2 |
36 |
Correct |
1 ms |
2396 KB |
n = 81, m = 6 |
37 |
Correct |
1 ms |
2396 KB |
n = 98, m = 7 |
38 |
Correct |
1 ms |
2396 KB |
n = 92, m = 7 |
39 |
Correct |
1 ms |
2396 KB |
n = 88, m = 21 |
40 |
Correct |
1 ms |
2396 KB |
n = 90, m = 21 |
41 |
Correct |
1 ms |
2396 KB |
n = 98, m = 22 |
42 |
Correct |
1 ms |
2396 KB |
n = 11, m = 2 |
43 |
Correct |
1 ms |
2496 KB |
n = 11, m = 2 |
44 |
Correct |
1 ms |
2396 KB |
n = 13, m = 3 |
45 |
Correct |
1 ms |
2396 KB |
n = 86, m = 2 |
46 |
Correct |
1 ms |
2392 KB |
n = 81, m = 2 |
47 |
Correct |
1 ms |
2396 KB |
n = 93, m = 2 |
48 |
Correct |
1 ms |
2396 KB |
n = 81, m = 2 |
49 |
Correct |
1 ms |
2396 KB |
n = 86, m = 2 |
50 |
Correct |
1 ms |
2396 KB |
n = 90, m = 2 |
51 |
Correct |
1 ms |
2396 KB |
n = 87, m = 2 |
52 |
Correct |
1 ms |
2396 KB |
n = 97, m = 2 |
53 |
Correct |
1 ms |
2396 KB |
n = 85, m = 2 |
54 |
Correct |
1 ms |
2648 KB |
n = 88, m = 7 |
55 |
Correct |
1 ms |
2496 KB |
n = 96, m = 7 |
56 |
Correct |
1 ms |
2392 KB |
n = 85, m = 7 |
57 |
Correct |
1 ms |
2392 KB |
n = 92, m = 7 |
58 |
Correct |
1 ms |
2396 KB |
n = 92, m = 7 |
59 |
Correct |
1 ms |
2396 KB |
n = 86, m = 7 |
60 |
Correct |
1 ms |
2396 KB |
n = 87, m = 7 |
61 |
Correct |
1 ms |
2392 KB |
n = 100, m = 7 |
62 |
Correct |
1 ms |
2548 KB |
n = 100, m = 7 |
63 |
Correct |
1 ms |
2396 KB |
n = 92, m = 21 |
64 |
Correct |
1 ms |
2396 KB |
n = 93, m = 22 |
65 |
Correct |
1 ms |
2392 KB |
n = 95, m = 22 |
66 |
Correct |
1 ms |
2396 KB |
n = 98, m = 22 |
67 |
Correct |
1 ms |
2396 KB |
n = 94, m = 22 |
68 |
Correct |
1 ms |
2396 KB |
n = 93, m = 22 |
69 |
Correct |
1 ms |
2392 KB |
n = 88, m = 21 |
70 |
Correct |
1 ms |
2392 KB |
n = 83, m = 20 |
71 |
Correct |
1 ms |
2396 KB |
n = 99, m = 23 |
72 |
Correct |
1 ms |
2396 KB |
n = 96, m = 19 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2392 KB |
n = 13, m = 1 |
2 |
Correct |
1 ms |
2396 KB |
n = 18, m = 1 |
3 |
Correct |
1 ms |
2396 KB |
n = 17, m = 1 |
4 |
Correct |
1 ms |
2396 KB |
n = 1, m = 1 |
5 |
Correct |
1 ms |
2496 KB |
n = 20, m = 1 |
6 |
Correct |
1 ms |
2396 KB |
n = 20, m = 1 |
7 |
Correct |
1 ms |
2396 KB |
n = 20, m = 1 |
8 |
Correct |
1 ms |
2396 KB |
n = 20, m = 5 |
9 |
Correct |
1 ms |
2396 KB |
n = 18, m = 3 |
10 |
Correct |
1 ms |
2396 KB |
n = 17, m = 2 |
11 |
Correct |
1 ms |
2396 KB |
n = 20, m = 2 |
12 |
Correct |
1 ms |
2392 KB |
n = 17, m = 4 |
13 |
Correct |
1 ms |
2396 KB |
n = 17, m = 6 |
14 |
Correct |
1 ms |
2396 KB |
n = 17, m = 1 |
15 |
Correct |
1 ms |
2396 KB |
n = 17, m = 4 |
16 |
Correct |
1 ms |
2396 KB |
n = 13, m = 3 |
17 |
Correct |
1 ms |
2396 KB |
n = 18, m = 4 |
18 |
Correct |
1 ms |
2396 KB |
n = 20, m = 10 |
19 |
Correct |
1 ms |
2396 KB |
n = 19, m = 10 |
20 |
Correct |
1 ms |
2396 KB |
n = 100, m = 5 |
21 |
Correct |
1 ms |
2396 KB |
n = 90, m = 3 |
22 |
Correct |
1 ms |
2396 KB |
n = 86, m = 2 |
23 |
Correct |
1 ms |
2652 KB |
n = 81, m = 4 |
24 |
Correct |
1 ms |
2392 KB |
n = 89, m = 10 |
25 |
Correct |
1 ms |
2396 KB |
n = 81, m = 23 |
26 |
Correct |
1 ms |
2396 KB |
n = 86, m = 8 |
27 |
Correct |
1 ms |
2396 KB |
n = 53, m = 22 |
28 |
Correct |
1 ms |
2396 KB |
n = 89, m = 35 |
29 |
Correct |
1 ms |
2396 KB |
n = 63, m = 25 |
30 |
Correct |
1 ms |
2396 KB |
n = 100, m = 50 |
31 |
Correct |
1 ms |
2396 KB |
n = 99, m = 50 |
32 |
Correct |
1 ms |
2392 KB |
n = 13, m = 4 |
33 |
Correct |
1 ms |
2396 KB |
n = 86, m = 2 |
34 |
Correct |
1 ms |
2396 KB |
n = 88, m = 2 |
35 |
Correct |
1 ms |
2392 KB |
n = 86, m = 2 |
36 |
Correct |
1 ms |
2396 KB |
n = 81, m = 6 |
37 |
Correct |
1 ms |
2396 KB |
n = 98, m = 7 |
38 |
Correct |
1 ms |
2396 KB |
n = 92, m = 7 |
39 |
Correct |
1 ms |
2396 KB |
n = 88, m = 21 |
40 |
Correct |
1 ms |
2396 KB |
n = 90, m = 21 |
41 |
Correct |
1 ms |
2396 KB |
n = 98, m = 22 |
42 |
Correct |
1 ms |
2396 KB |
n = 11, m = 2 |
43 |
Correct |
1 ms |
2496 KB |
n = 11, m = 2 |
44 |
Correct |
1 ms |
2396 KB |
n = 13, m = 3 |
45 |
Correct |
1 ms |
2396 KB |
n = 86, m = 2 |
46 |
Correct |
1 ms |
2392 KB |
n = 81, m = 2 |
47 |
Correct |
1 ms |
2396 KB |
n = 93, m = 2 |
48 |
Correct |
1 ms |
2396 KB |
n = 81, m = 2 |
49 |
Correct |
1 ms |
2396 KB |
n = 86, m = 2 |
50 |
Correct |
1 ms |
2396 KB |
n = 90, m = 2 |
51 |
Correct |
1 ms |
2396 KB |
n = 87, m = 2 |
52 |
Correct |
1 ms |
2396 KB |
n = 97, m = 2 |
53 |
Correct |
1 ms |
2396 KB |
n = 85, m = 2 |
54 |
Correct |
1 ms |
2648 KB |
n = 88, m = 7 |
55 |
Correct |
1 ms |
2496 KB |
n = 96, m = 7 |
56 |
Correct |
1 ms |
2392 KB |
n = 85, m = 7 |
57 |
Correct |
1 ms |
2392 KB |
n = 92, m = 7 |
58 |
Correct |
1 ms |
2396 KB |
n = 92, m = 7 |
59 |
Correct |
1 ms |
2396 KB |
n = 86, m = 7 |
60 |
Correct |
1 ms |
2396 KB |
n = 87, m = 7 |
61 |
Correct |
1 ms |
2392 KB |
n = 100, m = 7 |
62 |
Correct |
1 ms |
2548 KB |
n = 100, m = 7 |
63 |
Correct |
1 ms |
2396 KB |
n = 92, m = 21 |
64 |
Correct |
1 ms |
2396 KB |
n = 93, m = 22 |
65 |
Correct |
1 ms |
2392 KB |
n = 95, m = 22 |
66 |
Correct |
1 ms |
2396 KB |
n = 98, m = 22 |
67 |
Correct |
1 ms |
2396 KB |
n = 94, m = 22 |
68 |
Correct |
1 ms |
2396 KB |
n = 93, m = 22 |
69 |
Correct |
1 ms |
2392 KB |
n = 88, m = 21 |
70 |
Correct |
1 ms |
2392 KB |
n = 83, m = 20 |
71 |
Correct |
1 ms |
2396 KB |
n = 99, m = 23 |
72 |
Correct |
1 ms |
2396 KB |
n = 96, m = 19 |
73 |
Correct |
2 ms |
3676 KB |
n = 4825, m = 5 |
74 |
Correct |
1 ms |
3420 KB |
n = 4384, m = 5 |
75 |
Correct |
2 ms |
3420 KB |
n = 4528, m = 5 |
76 |
Correct |
2 ms |
3676 KB |
n = 4980, m = 5 |
77 |
Correct |
1 ms |
3420 KB |
n = 4730, m = 5 |
78 |
Correct |
1 ms |
3676 KB |
n = 4784, m = 5 |
79 |
Correct |
2 ms |
3672 KB |
n = 4875, m = 5 |
80 |
Correct |
1 ms |
3420 KB |
n = 4576, m = 5 |
81 |
Correct |
1 ms |
3420 KB |
n = 4297, m = 5 |
82 |
Correct |
4 ms |
3672 KB |
n = 4662, m = 48 |
83 |
Correct |
5 ms |
3676 KB |
n = 4753, m = 49 |
84 |
Correct |
4 ms |
3420 KB |
n = 4148, m = 46 |
85 |
Correct |
4 ms |
3588 KB |
n = 4906, m = 50 |
86 |
Correct |
4 ms |
3672 KB |
n = 4967, m = 50 |
87 |
Correct |
4 ms |
3676 KB |
n = 4828, m = 49 |
88 |
Correct |
4 ms |
3272 KB |
n = 4105, m = 45 |
89 |
Correct |
4 ms |
3676 KB |
n = 4954, m = 50 |
90 |
Correct |
4 ms |
3676 KB |
n = 4884, m = 49 |
91 |
Correct |
7 ms |
3524 KB |
n = 4307, m = 100 |
92 |
Correct |
8 ms |
3624 KB |
n = 4668, m = 100 |
93 |
Correct |
9 ms |
3420 KB |
n = 4647, m = 100 |
94 |
Correct |
7 ms |
3420 KB |
n = 4372, m = 100 |
95 |
Correct |
7 ms |
3624 KB |
n = 4791, m = 100 |
96 |
Correct |
6 ms |
3420 KB |
n = 4029, m = 100 |
97 |
Correct |
7 ms |
3420 KB |
n = 4439, m = 100 |
98 |
Correct |
6 ms |
3268 KB |
n = 4018, m = 100 |
99 |
Correct |
8 ms |
3672 KB |
n = 4979, m = 100 |
100 |
Correct |
7 ms |
3676 KB |
n = 4996, m = 89 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2392 KB |
n = 13, m = 1 |
2 |
Correct |
1 ms |
2396 KB |
n = 18, m = 1 |
3 |
Correct |
1 ms |
2396 KB |
n = 17, m = 1 |
4 |
Correct |
1 ms |
2396 KB |
n = 1, m = 1 |
5 |
Correct |
1 ms |
2496 KB |
n = 20, m = 1 |
6 |
Correct |
1 ms |
2396 KB |
n = 20, m = 1 |
7 |
Correct |
1 ms |
2396 KB |
n = 20, m = 1 |
8 |
Correct |
1 ms |
2396 KB |
n = 20, m = 5 |
9 |
Correct |
1 ms |
2396 KB |
n = 18, m = 3 |
10 |
Correct |
1 ms |
2396 KB |
n = 17, m = 2 |
11 |
Correct |
1 ms |
2396 KB |
n = 20, m = 2 |
12 |
Correct |
1 ms |
2392 KB |
n = 17, m = 4 |
13 |
Correct |
1 ms |
2396 KB |
n = 17, m = 6 |
14 |
Correct |
1 ms |
2396 KB |
n = 17, m = 1 |
15 |
Correct |
1 ms |
2396 KB |
n = 17, m = 4 |
16 |
Correct |
1 ms |
2396 KB |
n = 13, m = 3 |
17 |
Correct |
1 ms |
2396 KB |
n = 18, m = 4 |
18 |
Correct |
1 ms |
2396 KB |
n = 20, m = 10 |
19 |
Correct |
1 ms |
2396 KB |
n = 19, m = 10 |
20 |
Correct |
1 ms |
2396 KB |
n = 100, m = 5 |
21 |
Correct |
1 ms |
2396 KB |
n = 90, m = 3 |
22 |
Correct |
1 ms |
2396 KB |
n = 86, m = 2 |
23 |
Correct |
1 ms |
2652 KB |
n = 81, m = 4 |
24 |
Correct |
1 ms |
2392 KB |
n = 89, m = 10 |
25 |
Correct |
1 ms |
2396 KB |
n = 81, m = 23 |
26 |
Correct |
1 ms |
2396 KB |
n = 86, m = 8 |
27 |
Correct |
1 ms |
2396 KB |
n = 53, m = 22 |
28 |
Correct |
1 ms |
2396 KB |
n = 89, m = 35 |
29 |
Correct |
1 ms |
2396 KB |
n = 63, m = 25 |
30 |
Correct |
1 ms |
2396 KB |
n = 100, m = 50 |
31 |
Correct |
1 ms |
2396 KB |
n = 99, m = 50 |
32 |
Correct |
1 ms |
2392 KB |
n = 13, m = 4 |
33 |
Correct |
1 ms |
2396 KB |
n = 86, m = 2 |
34 |
Correct |
1 ms |
2396 KB |
n = 88, m = 2 |
35 |
Correct |
1 ms |
2392 KB |
n = 86, m = 2 |
36 |
Correct |
1 ms |
2396 KB |
n = 81, m = 6 |
37 |
Correct |
1 ms |
2396 KB |
n = 98, m = 7 |
38 |
Correct |
1 ms |
2396 KB |
n = 92, m = 7 |
39 |
Correct |
1 ms |
2396 KB |
n = 88, m = 21 |
40 |
Correct |
1 ms |
2396 KB |
n = 90, m = 21 |
41 |
Correct |
1 ms |
2396 KB |
n = 98, m = 22 |
42 |
Correct |
1 ms |
2396 KB |
n = 11, m = 2 |
43 |
Correct |
1 ms |
2496 KB |
n = 11, m = 2 |
44 |
Correct |
1 ms |
2396 KB |
n = 13, m = 3 |
45 |
Correct |
1 ms |
2396 KB |
n = 86, m = 2 |
46 |
Correct |
1 ms |
2392 KB |
n = 81, m = 2 |
47 |
Correct |
1 ms |
2396 KB |
n = 93, m = 2 |
48 |
Correct |
1 ms |
2396 KB |
n = 81, m = 2 |
49 |
Correct |
1 ms |
2396 KB |
n = 86, m = 2 |
50 |
Correct |
1 ms |
2396 KB |
n = 90, m = 2 |
51 |
Correct |
1 ms |
2396 KB |
n = 87, m = 2 |
52 |
Correct |
1 ms |
2396 KB |
n = 97, m = 2 |
53 |
Correct |
1 ms |
2396 KB |
n = 85, m = 2 |
54 |
Correct |
1 ms |
2648 KB |
n = 88, m = 7 |
55 |
Correct |
1 ms |
2496 KB |
n = 96, m = 7 |
56 |
Correct |
1 ms |
2392 KB |
n = 85, m = 7 |
57 |
Correct |
1 ms |
2392 KB |
n = 92, m = 7 |
58 |
Correct |
1 ms |
2396 KB |
n = 92, m = 7 |
59 |
Correct |
1 ms |
2396 KB |
n = 86, m = 7 |
60 |
Correct |
1 ms |
2396 KB |
n = 87, m = 7 |
61 |
Correct |
1 ms |
2392 KB |
n = 100, m = 7 |
62 |
Correct |
1 ms |
2548 KB |
n = 100, m = 7 |
63 |
Correct |
1 ms |
2396 KB |
n = 92, m = 21 |
64 |
Correct |
1 ms |
2396 KB |
n = 93, m = 22 |
65 |
Correct |
1 ms |
2392 KB |
n = 95, m = 22 |
66 |
Correct |
1 ms |
2396 KB |
n = 98, m = 22 |
67 |
Correct |
1 ms |
2396 KB |
n = 94, m = 22 |
68 |
Correct |
1 ms |
2396 KB |
n = 93, m = 22 |
69 |
Correct |
1 ms |
2392 KB |
n = 88, m = 21 |
70 |
Correct |
1 ms |
2392 KB |
n = 83, m = 20 |
71 |
Correct |
1 ms |
2396 KB |
n = 99, m = 23 |
72 |
Correct |
1 ms |
2396 KB |
n = 96, m = 19 |
73 |
Correct |
2 ms |
3676 KB |
n = 4825, m = 5 |
74 |
Correct |
1 ms |
3420 KB |
n = 4384, m = 5 |
75 |
Correct |
2 ms |
3420 KB |
n = 4528, m = 5 |
76 |
Correct |
2 ms |
3676 KB |
n = 4980, m = 5 |
77 |
Correct |
1 ms |
3420 KB |
n = 4730, m = 5 |
78 |
Correct |
1 ms |
3676 KB |
n = 4784, m = 5 |
79 |
Correct |
2 ms |
3672 KB |
n = 4875, m = 5 |
80 |
Correct |
1 ms |
3420 KB |
n = 4576, m = 5 |
81 |
Correct |
1 ms |
3420 KB |
n = 4297, m = 5 |
82 |
Correct |
4 ms |
3672 KB |
n = 4662, m = 48 |
83 |
Correct |
5 ms |
3676 KB |
n = 4753, m = 49 |
84 |
Correct |
4 ms |
3420 KB |
n = 4148, m = 46 |
85 |
Correct |
4 ms |
3588 KB |
n = 4906, m = 50 |
86 |
Correct |
4 ms |
3672 KB |
n = 4967, m = 50 |
87 |
Correct |
4 ms |
3676 KB |
n = 4828, m = 49 |
88 |
Correct |
4 ms |
3272 KB |
n = 4105, m = 45 |
89 |
Correct |
4 ms |
3676 KB |
n = 4954, m = 50 |
90 |
Correct |
4 ms |
3676 KB |
n = 4884, m = 49 |
91 |
Correct |
7 ms |
3524 KB |
n = 4307, m = 100 |
92 |
Correct |
8 ms |
3624 KB |
n = 4668, m = 100 |
93 |
Correct |
9 ms |
3420 KB |
n = 4647, m = 100 |
94 |
Correct |
7 ms |
3420 KB |
n = 4372, m = 100 |
95 |
Correct |
7 ms |
3624 KB |
n = 4791, m = 100 |
96 |
Correct |
6 ms |
3420 KB |
n = 4029, m = 100 |
97 |
Correct |
7 ms |
3420 KB |
n = 4439, m = 100 |
98 |
Correct |
6 ms |
3268 KB |
n = 4018, m = 100 |
99 |
Correct |
8 ms |
3672 KB |
n = 4979, m = 100 |
100 |
Correct |
7 ms |
3676 KB |
n = 4996, m = 89 |
101 |
Correct |
69 ms |
85664 KB |
n = 178952, m = 10 |
102 |
Correct |
67 ms |
85664 KB |
n = 180674, m = 10 |
103 |
Correct |
68 ms |
81072 KB |
n = 167639, m = 10 |
104 |
Correct |
63 ms |
81576 KB |
n = 172892, m = 10 |
105 |
Correct |
64 ms |
80936 KB |
n = 168125, m = 10 |
106 |
Correct |
56 ms |
76904 KB |
n = 166514, m = 10 |
107 |
Correct |
65 ms |
85768 KB |
n = 183874, m = 10 |
108 |
Correct |
67 ms |
90076 KB |
n = 194560, m = 10 |
109 |
Correct |
60 ms |
81580 KB |
n = 171994, m = 10 |
110 |
Correct |
405 ms |
76972 KB |
n = 165207, m = 100 |
111 |
Correct |
472 ms |
90268 KB |
n = 188459, m = 100 |
112 |
Correct |
389 ms |
76960 KB |
n = 162137, m = 100 |
113 |
Correct |
398 ms |
81388 KB |
n = 169691, m = 100 |
114 |
Correct |
445 ms |
89896 KB |
n = 187642, m = 100 |
115 |
Correct |
376 ms |
81128 KB |
n = 168456, m = 100 |
116 |
Correct |
454 ms |
85732 KB |
n = 180980, m = 100 |
117 |
Correct |
447 ms |
90008 KB |
n = 191687, m = 100 |
118 |
Correct |
385 ms |
76836 KB |
n = 166437, m = 100 |
119 |
Correct |
464 ms |
87848 KB |
n = 186520, m = 100 |
120 |
Correct |
387 ms |
76976 KB |
n = 166675, m = 100 |
121 |
Correct |
469 ms |
89912 KB |
n = 187725, m = 100 |
122 |
Correct |
369 ms |
76976 KB |
n = 161455, m = 100 |
123 |
Correct |
463 ms |
90100 KB |
n = 192977, m = 100 |
124 |
Correct |
457 ms |
90056 KB |
n = 192612, m = 100 |
125 |
Correct |
460 ms |
90092 KB |
n = 196512, m = 100 |
126 |
Correct |
476 ms |
91020 KB |
n = 198968, m = 100 |
127 |
Correct |
353 ms |
77080 KB |
n = 166659, m = 100 |
128 |
Correct |
198 ms |
91020 KB |
n = 199997, m = 34 |
129 |
Correct |
24 ms |
90764 KB |
n = 200000, m = 1 |
130 |
Correct |
24 ms |
91020 KB |
n = 200000, m = 1 |
131 |
Correct |
562 ms |
91180 KB |
n = 199999, m = 100 |
132 |
Correct |
544 ms |
90924 KB |
n = 199999, m = 100 |
133 |
Correct |
47 ms |
90768 KB |
n = 200000, m = 1 |