QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#121561 | #4273. Good Game | bashkort# | 9 | 6ms | 4204kb | C++20 | 2.3kb | 2023-07-08 14:19:03 | 2024-07-04 00:31:05 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
string s;
cin >> s;
vector dp(n, vector<int>(n));
for (int l = n - 1; l >= 0; --l) {
for (int r = l + 1; r < n; ++r) {
if (r <= l + 2 && s[l] == s[r] && s[l] == s[l + r >> 1]) {
dp[l][r] = -1;
} else {
for (int mid = l + 1; mid + 1 < r; ++mid) {
if (dp[l][mid] && dp[mid + 1][r]) {
dp[l][r] = mid;
break;
}
}
if (!dp[l][r] && s[l] == s[r]) {
for (int mid = l + 1; mid < r; ++mid) {
if (s[mid] == s[l] && (l + 1 > mid - 1 ? true : dp[l + 1][mid - 1]) && (mid + 1 > r - 1 ? true : dp[mid + 1][r - 1])) {
dp[l][r] = ~mid;
break;
}
}
if (dp[l + 1][r - 1]) {
dp[l][r] = r;
}
}
}
}
}
if (!dp[0][n - 1]) {
cout << "-1\n";
return 0;
}
vector<pair<int, int>> ans;
auto dfs = [&](auto dfs, int l, int r, int del) -> int {
if (l > r) {
return 0;
}
if (l + 2 >= r) {
ans.push_back({l - del, r - l + 1});
return r - l + 1;
}
if (dp[l][r] >= 0) {
int mid = dp[l][r];
if (mid < r) {
del += dfs(dfs, l, mid, del);
dfs(dfs, mid + 1, r, del);
} else {
dfs(dfs, l + 1, r - 1, del);
ans.push_back({l - del, 2});
}
} else {
int mid = ~dp[l][r];
int d = del;
del += dfs(dfs, l + 1, mid - 1, del);
del += dfs(dfs, mid + 1, r - 1, del);
ans.push_back({l - d, 3});
}
return r - l + 1;
};
dfs(dfs, 0, n - 1, 0);
cout << size(ans) << '\n';
for (auto [l, r] : ans) {
cout << l + 1 << " " << r << '\n';
}
return 0;
}
详细
Subtask #1:
score: 3
Accepted
Test #1:
score: 3
Accepted
time: 0ms
memory: 3592kb
input:
9 ABAABBBAA
output:
4 3 2 2 2 2 2 1 3
result:
ok good solution!
Test #2:
score: 0
Accepted
time: 0ms
memory: 3828kb
input:
13 ABABBABABBABA
output:
6 4 2 3 2 5 2 4 2 2 3 1 2
result:
ok good solution!
Test #3:
score: 0
Accepted
time: 0ms
memory: 3488kb
input:
15 AABABAABABAABAB
output:
7 1 2 4 2 3 2 5 2 4 2 2 3 1 2
result:
ok good solution!
Test #4:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
15 ABAABBBABAABBAB
output:
7 3 2 2 2 2 2 1 2 4 2 2 3 1 2
result:
ok good solution!
Test #5:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
1 B
output:
-1
result:
ok no solution
Test #6:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
2 BB
output:
1 1 2
result:
ok good solution!
Test #7:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
7 AAAABBB
output:
3 1 2 1 2 1 3
result:
ok good solution!
Test #8:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
11 BBBBBBAAAAA
output:
5 1 2 1 2 1 2 1 2 1 3
result:
ok good solution!
Test #9:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
2 AB
output:
-1
result:
ok no solution
Test #10:
score: 0
Accepted
time: 0ms
memory: 3488kb
input:
14 BAAAAAAAAAAAAA
output:
-1
result:
ok no solution
Test #11:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
14 ABBABAABBABBAB
output:
7 2 2 1 2 2 2 1 2 3 2 2 2 1 2
result:
ok good solution!
Test #12:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
15 BAABABABBABBAAB
output:
6 2 2 6 2 5 2 4 3 3 3 1 3
result:
ok good solution!
Test #13:
score: 0
Accepted
time: 0ms
memory: 3484kb
input:
14 BABBBBBBBBBBAB
output:
7 3 2 3 2 3 2 3 2 3 2 2 2 1 2
result:
ok good solution!
Test #14:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
15 BABAAAAAAAAABAB
output:
7 4 2 4 2 4 2 4 3 3 2 2 2 1 2
result:
ok good solution!
Test #15:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
14 BBBABAAAAAAABA
output:
6 1 3 3 2 3 2 3 3 2 2 1 2
result:
ok good solution!
Test #16:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
15 AAAABABAAAAABAB
output:
7 1 2 1 2 4 2 4 3 3 2 2 2 1 2
result:
ok good solution!
Test #17:
score: 0
Accepted
time: 0ms
memory: 3828kb
input:
14 BAAABABAAAABAB
output:
6 2 3 5 2 5 2 4 2 3 2 1 3
result:
ok good solution!
Test #18:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
15 ABAAAABABBBBABA
output:
7 3 2 3 2 5 2 5 2 4 2 2 3 1 2
result:
ok good solution!
Test #19:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
14 BABAAABAAAABAB
output:
6 4 3 5 2 5 2 3 3 2 2 1 2
result:
ok good solution!
Test #20:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
15 BABBABABBBBBBAB
output:
7 3 2 2 2 4 2 4 2 4 2 3 2 1 3
result:
ok good solution!
Test #21:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
14 BABAAAABABBBAB
output:
6 4 2 4 2 3 2 4 3 2 3 1 2
result:
ok good solution!
Test #22:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
15 BABAAAAAABABAAB
output:
7 4 2 4 2 4 2 3 2 2 2 3 2 1 3
result:
ok good solution!
Test #23:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
14 BABBBBBABAAAAA
output:
6 3 2 3 3 2 2 1 2 1 2 1 3
result:
ok good solution!
Test #24:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
15 BABAAAABABAAAAA
output:
7 4 2 4 2 3 2 2 2 1 2 1 2 1 3
result:
ok good solution!
Test #25:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
15 BAABABAABAABBAA
output:
7 2 2 1 2 3 2 2 2 1 2 2 2 1 3
result:
ok good solution!
Test #26:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
15 AABAABBAABAABAB
output:
7 1 2 2 2 1 2 5 2 4 2 2 3 1 2
result:
ok good solution!
Test #27:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
15 AABABBABAABBABB
output:
7 1 2 3 2 2 2 1 2 3 2 1 3 1 2
result:
ok good solution!
Test #28:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
15 BAABBABBAABABBA
output:
7 2 2 1 2 3 2 2 3 1 2 2 2 1 2
result:
ok good solution!
Test #29:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
15 BBAABBABABABBAA
output:
-1
result:
ok no solution
Test #30:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
15 ABABBAABBAABBAB
output:
-1
result:
ok no solution
Test #31:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
14 AAABAAAAABAAAB
output:
5 1 3 2 2 2 3 3 3 1 3
result:
ok good solution!
Test #32:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
15 ABBBBABBBBBABBB
output:
6 2 2 2 2 3 2 3 3 1 3 1 3
result:
ok good solution!
Test #33:
score: 0
Accepted
time: 0ms
memory: 3756kb
input:
14 BBBBABBABAAABA
output:
6 1 2 1 2 2 2 4 3 3 2 1 3
result:
ok good solution!
Test #34:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
15 AAAAABABBBABBAB
output:
6 1 2 1 3 3 3 4 2 2 3 1 2
result:
ok good solution!
Test #35:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
14 AABABBBBABAAAB
output:
6 1 2 3 2 3 2 2 2 3 3 1 3
result:
ok good solution!
Test #36:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
15 BAABAAAABABBBBA
output:
7 2 2 3 2 3 2 1 3 2 2 2 2 1 2
result:
ok good solution!
Test #37:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
14 ABBBABAAABAAAB
output:
5 2 3 1 2 2 3 3 3 1 3
result:
ok good solution!
Test #38:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
15 BAAABABBBBABAAA
output:
6 2 3 4 2 4 2 3 2 1 3 1 3
result:
ok good solution!
Test #39:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
14 BABBABBBBABAAA
output:
6 3 2 4 2 4 2 2 3 1 2 1 3
result:
ok good solution!
Test #40:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
15 ABAAABABBBABBBB
output:
6 3 3 2 2 3 3 1 3 1 2 1 2
result:
ok good solution!
Test #41:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
14 AABABABBAABBAA
output:
-1
result:
ok no solution
Test #42:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
15 AABBBABABAABBAA
output:
-1
result:
ok no solution
Test #43:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
14 AABBAABABABBAA
output:
-1
result:
ok no solution
Test #44:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
15 BBBAABBAABABABB
output:
-1
result:
ok no solution
Test #45:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
15 BABABBBBAABBAAA
output:
-1
result:
ok no solution
Test #46:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
15 BBBABABAABBBAAA
output:
-1
result:
ok no solution
Test #47:
score: 0
Accepted
time: 0ms
memory: 3756kb
input:
15 AAABBBBAABABABB
output:
-1
result:
ok no solution
Test #48:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
15 AAAAABBAABBABAB
output:
-1
result:
ok no solution
Test #49:
score: 0
Accepted
time: 0ms
memory: 3480kb
input:
15 BAAAABBAABBBABA
output:
-1
result:
ok no solution
Test #50:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
15 BABAAABBBAAABBA
output:
-1
result:
ok no solution
Subtask #2:
score: 6
Accepted
Test #51:
score: 6
Accepted
time: 1ms
memory: 3956kb
input:
299 ABABABABABABABABABABABABABABABABABBAABBAABBAABBAAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBBAABBAABBAABBAABBAABBAABBAABBAABBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA...
output:
-1
result:
ok no solution
Test #52:
score: 0
Accepted
time: 3ms
memory: 3748kb
input:
300 ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAABBAABBAABBAABBAABBAABBAABBAABBAAABBAABBAABBAABBAABBAABBAABBAABBBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAAB...
output:
-1
result:
ok no solution
Test #53:
score: 0
Accepted
time: 5ms
memory: 3904kb
input:
299 ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBBBBBBBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBBBBBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...
output:
149 96 2 96 2 96 2 96 2 95 2 94 2 93 2 92 2 91 2 90 2 89 2 88 2 87 2 86 2 85 2 84 2 83 2 82 2 81 2 80 2 79 2 78 2 77 2 76 2 75 2 74 2 73 2 72 2 71 2 70 2 69 2 68 2 67 2 66 2 65 2 64 2 63 2 62 2 61 2 60 2 59 2 58 2 57 2 56 2 55 2 54 2 53 2 52 2 51 2 50 2 49 2 97 2 97 2 97 2 96 2 95 2 94 2 93 2 92 2 9...
result:
ok good solution!
Test #54:
score: 0
Accepted
time: 2ms
memory: 3968kb
input:
299 BBBBBBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBBBBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...
output:
148 1 2 1 2 1 2 96 3 95 2 94 2 93 2 92 2 91 2 90 2 89 2 88 2 87 2 86 2 85 2 84 2 83 2 82 2 81 2 80 2 79 2 78 2 77 2 76 2 75 2 74 2 73 2 72 2 71 2 70 2 69 2 68 2 67 2 66 2 65 2 64 2 63 2 62 2 61 2 60 2 59 2 58 2 57 2 56 2 55 2 54 2 53 2 52 2 51 2 50 2 49 2 97 2 97 3 96 2 95 2 94 2 93 2 92 2 91 2 90 2...
result:
ok good solution!
Test #55:
score: 0
Accepted
time: 5ms
memory: 3908kb
input:
297 BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAABBBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA
output:
148 74 2 73 2 73 2 72 2 71 2 70 2 69 2 68 2 67 2 66 2 65 2 64 2 63 2 62 2 61 2 60 2 59 2 58 2 57 2 56 2 55 2 54 2 53 2 52 2 51 2 50 2 49 2 48 2 47 2 46 2 45 2 44 2 43 2 42 2 41 2 40 2 39 2 38 2 37 2 36 2 35 2 34 2 33 2 32 2 31 2 30 2 29 2 28 2 27 2 26 2 25 2 24 2 23 2 22 2 21 2 20 2 19 2 18 2 17 2 1...
result:
ok good solution!
Test #56:
score: 0
Accepted
time: 5ms
memory: 3984kb
input:
300 BABABABABABABABABABABABABABABABABABABABABABABABABABABABABAAAABBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBBAAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA...
output:
149 58 2 60 2 58 3 57 2 56 2 55 2 54 2 53 2 52 2 51 2 50 2 49 2 48 2 47 2 46 2 45 2 44 2 43 2 42 2 41 2 40 2 39 2 38 2 37 2 36 2 35 2 34 2 33 2 32 2 31 2 30 2 29 2 28 2 27 2 26 2 25 2 24 2 23 2 22 2 21 2 20 2 19 2 18 2 17 2 16 2 15 2 14 2 13 2 12 2 11 2 10 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 88 3 ...
result:
ok good solution!
Test #57:
score: 0
Accepted
time: 5ms
memory: 4188kb
input:
299 ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBBAABBBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA...
output:
148 59 3 58 2 57 2 56 2 55 2 54 2 53 2 52 2 51 2 50 2 49 2 48 2 47 2 46 2 45 2 44 2 43 2 42 2 41 2 40 2 39 2 38 2 37 2 36 2 35 2 34 2 33 2 32 2 31 2 30 2 29 2 28 2 27 2 26 2 25 2 24 2 23 2 22 2 21 2 20 2 19 2 18 2 17 2 16 2 15 2 14 2 13 2 12 2 11 2 10 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 87 3 86 2 ...
result:
ok good solution!
Test #58:
score: 0
Accepted
time: 2ms
memory: 3920kb
input:
300 ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAAAABBAAAABABABABABABABABABABABABABABABABABABABABABAB...
output:
150 98 2 97 2 96 2 95 2 94 2 93 2 92 2 91 2 90 2 89 2 88 2 87 2 86 2 85 2 84 2 83 2 82 2 81 2 80 2 79 2 78 2 77 2 76 2 75 2 74 2 73 2 72 2 71 2 70 2 69 2 68 2 67 2 66 2 65 2 64 2 63 2 62 2 61 2 60 2 59 2 58 2 57 2 56 2 55 2 54 2 53 2 52 2 51 2 50 2 49 2 48 2 47 2 46 2 45 2 44 2 43 2 42 2 41 2 40 2 3...
result:
ok good solution!
Test #59:
score: 0
Accepted
time: 1ms
memory: 4124kb
input:
298 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
output:
149 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 ...
result:
ok good solution!
Test #60:
score: 0
Accepted
time: 1ms
memory: 3728kb
input:
298 BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
output:
-1
result:
ok no solution
Test #61:
score: 0
Accepted
time: 1ms
memory: 3960kb
input:
297 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
output:
148 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 3 ...
result:
ok good solution!
Test #62:
score: 0
Accepted
time: 1ms
memory: 3976kb
input:
300 AAAABBBBAAAABBBBBBAABBAABBBBAAAAABBBBBAAAABBBBAAAABBBBBBAABBBAAAABBBBAAAABBBBBBAAAAABBAAABBAAABBBBBAAAABBBBAAABBBBAAAAAABBBBAABBAAAABBBBAAABBBBBAAABBBBBAAAABBAAABBBAABBBAAAABBBAAAAAABBBBBBAAABBAAAAAABBBBBAAAAAABBBBAAAAABBBBAAAABBBBBBAAABBBBAAAAAAABBAAAAAAABBBBBAAAABBBBAAAAABBBAAAAABBBAAAABBBBAAA...
output:
146 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 2 2 2 3 1 2 1 2 2 2 2 2 1 2 1 2 2 2 2 2 2 2 1 2 2 3 1 2 1 2 2 2 2 2 1 2 1 2 2 2 2 2 2 2 1 2 1 2 1 2 1 2 1 2 2 2 1 2 1 2 1 2 1 2 2 2 2 2 1 2 1 2 2 3 1 2 1 2 2 2 2 2 2 2 1 2 1 2 2 2 1 2 2 2 2 2 1 2 1 2 2 3 1 2 1 2 1 2 1 2 2 2 2 3 1 2 ...
result:
ok good solution!
Test #63:
score: 0
Accepted
time: 2ms
memory: 3968kb
input:
299 BBBBBBBBBBBBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAAAAAAAAAABABABABABABABABABABABABABABABABABABABAAAAAAAAAAAAAAABABABABABABABABABABABABABABABABABABABABABABAAAAAAAAAAABABABABABABABABABABABABABABABABABABABABABBBBBBBABABABABABABABABABABABABABABABABABA...
output:
148 1 2 1 2 1 2 1 2 1 2 89 2 89 2 89 2 89 2 89 2 126 2 126 2 126 2 126 2 126 2 126 2 126 3 125 2 124 2 123 2 122 2 121 2 120 2 119 2 118 2 117 2 116 2 115 2 114 2 113 2 112 2 111 2 110 2 109 2 108 2 107 2 106 2 105 2 104 2 103 2 102 2 101 2 100 2 99 2 98 2 97 2 96 2 95 2 94 2 93 2 92 2 91 2 90 2 88 ...
result:
ok good solution!
Test #64:
score: 0
Accepted
time: 4ms
memory: 3896kb
input:
299 BABABABABABABABBBBBBBBBBABABABABABABABABABABABABABBBBBBBBBBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAAAAAAAAAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAAAAAAAAAABABABAAAAAAAAAAAAAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...
output:
148 15 2 15 2 15 2 15 2 15 2 14 2 13 2 12 2 11 2 10 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 12 2 12 2 12 2 12 2 72 2 72 2 72 2 72 2 72 2 71 2 70 2 69 2 68 2 67 2 66 2 65 2 64 2 63 2 62 2 61 2 60 2 59 2 58 2 57 2 56 2 55 2 54 2 53 2 52 2 51 2 50 2 49 2 48 2 47 2 46 2 45 2 85 2 85 2 85 2 85 2 85 2 84 2 ...
result:
ok good solution!
Test #65:
score: 0
Accepted
time: 0ms
memory: 3908kb
input:
298 ABABABABABABABABABAAAAABABABABABABABABABAAAABABABABABABABABABABABABABABABABBBBBBBABABABABABABABABABABABABABABABABABABABABABABABABABAAAAAABABABABABABABBBBBBABABABABABABABABABABBBBBBABABABABABABABABABABABABABABABBBBBBABAAAAAABABABABABABABABBBBBBBABABABBBBBBABABABABABABABABABABABABABABABABABABABABABA
output:
145 19 2 19 3 18 2 17 2 16 2 15 2 14 2 13 2 12 2 11 2 10 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 1 2 32 2 32 2 32 3 31 2 30 2 29 2 28 2 27 2 26 2 25 2 24 2 23 2 22 2 21 2 20 2 19 2 18 2 17 2 16 2 15 2 14 2 13 2 12 2 11 2 10 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 20 2 20 2 20 2 19 2 18 2 17 2 16 2 15 2 ...
result:
ok good solution!
Test #66:
score: 0
Accepted
time: 3ms
memory: 3916kb
input:
298 BABABABABABABABAAAAABABABABABABABABABABABABABAAAAAABABABABABABABABABABABABABABABABABABAAAAAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBBBBBABABABABABABAAAAAAAAAABBBBABABABAAAAAAAABABABABABABABAAAABABABABABABBBBBABABABABABABABABBBBABABABABABABABABABABABABABABABABABABABABABABABABABA
output:
146 16 2 16 3 15 2 14 2 13 2 12 2 11 2 10 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 11 2 11 2 11 2 10 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 26 2 26 2 26 2 25 2 24 2 23 2 22 2 21 2 20 2 19 2 18 2 17 2 16 2 15 2 14 2 13 2 12 2 11 2 10 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 34 2 34 2 34 2 33 2 32 2 31 2 30 ...
result:
ok good solution!
Test #67:
score: 0
Accepted
time: 2ms
memory: 4180kb
input:
297 BABABABABABABABABABABABAAAAAAABABABABABABABABABABABABABBABABABABABABABABABABABABABABABABABABABAAAAABABABABABABABAABBBBBBABAABABABABABABAAAAABABABABABBBBBBBABABABABABABABAAAABABABABAAAABABABBABABABABABABABABABABABABABABABABABABABABABABABBBBBBABABABABABABABABABABABABBBBBABABABAABBBBABABABABABABABAB
output:
145 24 2 24 2 24 3 23 2 22 2 21 2 20 2 19 2 18 2 17 2 16 2 15 2 14 2 13 2 12 2 11 2 10 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 2 2 1 2 38 2 38 3 37 2 36 2 35 2 34 2 33 2 32 2 31 2 30 2 29 2 28 2 27 2 26 2 25 2 24 3 23 2 23 2 23 3 22 2 21 2 20 3 19 2 18 2 17 2 16 2 15 2 14 2 13 2 12 2 11 2 10 2 9 2 8 2...
result:
ok good solution!
Test #68:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
297 BABABABABABABABABABABABABABABABABABABABAABABABABABBBBABABABAAAAAABABABABABABABBBBBABABABABABAAAABABABABABABABABABABABABABBABABABAAAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBBABAAAAABABAAAABABAAAAAAABABABABABABAAAAAAAABABABABABAAABABABABABABABABABABABABABABABABBBABABABABABABABBA
output:
144 40 2 39 2 38 2 37 2 36 2 35 2 34 2 33 2 32 2 31 2 31 3 30 2 29 2 28 2 27 2 26 2 25 2 24 2 24 2 24 3 23 2 22 2 21 2 20 2 19 2 18 2 17 2 16 2 15 2 14 2 13 2 12 2 11 2 11 2 11 2 10 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 1 2 1 2 25 2 24 2 23 2 22 2 21 2 20 2 19 2 18 2 18 3 17 2 16 2 15 2 14 2 13 2 12...
result:
ok good solution!
Test #69:
score: 0
Accepted
time: 5ms
memory: 4204kb
input:
299 BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA...
output:
149 149 3 148 2 147 2 146 2 145 2 144 2 143 2 142 2 141 2 140 2 139 2 138 2 137 2 136 2 135 2 134 2 133 2 132 2 131 2 130 2 129 2 128 2 127 2 126 2 125 2 124 2 123 2 122 2 121 2 120 2 119 2 118 2 117 2 116 2 115 2 114 2 113 2 112 2 111 2 110 2 109 2 108 2 107 2 106 2 105 2 104 2 103 2 102 2 101 2 10...
result:
ok good solution!
Test #70:
score: 0
Accepted
time: 5ms
memory: 4192kb
input:
300 BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...
output:
150 150 2 149 2 148 2 147 2 146 2 145 2 144 2 143 2 142 2 141 2 140 2 139 2 138 2 137 2 136 2 135 2 134 2 133 2 132 2 131 2 130 2 129 2 128 2 127 2 126 2 125 2 124 2 123 2 122 2 121 2 120 2 119 2 118 2 117 2 116 2 115 2 114 2 113 2 112 2 111 2 110 2 109 2 108 2 107 2 106 2 105 2 104 2 103 2 102 2 10...
result:
ok good solution!
Test #71:
score: 0
Accepted
time: 5ms
memory: 3912kb
input:
300 AABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAAAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...
output:
150 1 2 148 2 148 2 147 2 146 2 145 2 144 2 143 2 142 2 141 2 140 2 139 2 138 2 137 2 136 2 135 2 134 2 133 2 132 2 131 2 130 2 129 2 128 2 127 2 126 2 125 2 124 2 123 2 122 2 121 2 120 2 119 2 118 2 117 2 116 2 115 2 114 2 113 2 112 2 111 2 110 2 109 2 108 2 107 2 106 2 105 2 104 2 103 2 102 2 101 ...
result:
ok good solution!
Test #72:
score: 0
Accepted
time: 6ms
memory: 4156kb
input:
300 ABBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...
output:
150 2 2 1 2 148 2 147 2 146 2 145 2 144 2 143 2 142 2 141 2 140 2 139 2 138 2 137 2 136 2 135 2 134 2 133 2 132 2 131 2 130 2 129 2 128 2 127 2 126 2 125 2 124 2 123 2 122 2 121 2 120 2 119 2 118 2 117 2 116 2 115 2 114 2 113 2 112 2 111 2 110 2 109 2 108 2 107 2 106 2 105 2 104 2 103 2 102 2 101 2 ...
result:
ok good solution!
Test #73:
score: 0
Accepted
time: 2ms
memory: 3856kb
input:
300 BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA...
output:
149 61 3 60 2 59 2 58 2 57 2 56 2 55 2 54 2 53 2 52 2 51 2 50 2 49 2 48 2 47 2 46 2 45 2 44 2 43 2 42 2 41 2 40 2 39 2 38 2 37 2 36 2 35 2 34 2 33 2 32 2 31 2 30 2 29 2 28 2 27 2 26 2 25 2 24 2 23 2 22 2 21 2 20 2 19 2 18 2 17 2 16 2 15 2 14 2 13 2 12 2 11 2 10 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 ...
result:
ok good solution!
Test #74:
score: 0
Accepted
time: 5ms
memory: 4164kb
input:
300 ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAABABABABABABABABABABABAB...
output:
150 122 2 121 2 120 2 119 2 118 2 117 2 116 2 115 2 114 2 113 2 112 2 111 2 110 2 109 2 108 2 107 2 106 2 105 2 104 2 103 2 102 2 101 2 100 2 99 2 98 2 97 2 96 2 95 2 94 2 93 2 92 2 91 2 90 2 89 2 88 2 87 2 86 2 85 2 84 2 83 2 82 2 81 2 80 2 79 2 78 2 77 2 76 2 75 2 74 2 73 2 72 2 71 2 70 2 69 2 68 ...
result:
ok good solution!
Test #75:
score: 0
Accepted
time: 5ms
memory: 3924kb
input:
300 BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...
output:
150 148 2 147 2 146 2 145 2 144 2 143 2 142 2 141 2 140 2 139 2 138 2 137 2 136 2 135 2 134 2 133 2 132 2 131 2 130 2 129 2 128 2 127 2 126 2 125 2 124 2 123 2 122 2 121 2 120 2 119 2 118 2 117 2 116 2 115 2 114 2 113 2 112 2 111 2 110 2 109 2 108 2 107 2 106 2 105 2 104 2 103 2 102 2 101 2 100 2 99...
result:
ok good solution!
Test #76:
score: 0
Accepted
time: 5ms
memory: 3900kb
input:
299 ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...
output:
149 148 3 147 2 146 2 145 2 144 2 143 2 142 2 141 2 140 2 139 2 138 2 137 2 136 2 135 2 134 2 133 2 132 2 131 2 130 2 129 2 128 2 127 2 126 2 125 2 124 2 123 2 122 2 121 2 120 2 119 2 118 2 117 2 116 2 115 2 114 2 113 2 112 2 111 2 110 2 109 2 108 2 107 2 106 2 105 2 104 2 103 2 102 2 101 2 100 2 99...
result:
ok good solution!
Test #77:
score: 0
Accepted
time: 5ms
memory: 4200kb
input:
299 BAAAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA...
output:
149 2 2 2 2 148 2 147 2 146 2 145 2 144 2 143 2 142 2 141 2 140 2 139 2 138 2 137 2 136 2 135 2 134 2 133 2 132 2 131 2 130 2 129 2 128 2 127 2 126 2 125 2 124 2 123 2 122 2 121 2 120 2 119 2 118 2 117 2 116 2 115 2 114 2 113 2 112 2 111 2 110 2 109 2 108 2 107 2 106 2 105 2 104 2 103 2 102 2 101 2 ...
result:
ok good solution!
Test #78:
score: 0
Accepted
time: 5ms
memory: 3924kb
input:
299 BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAAAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA...
output:
149 62 2 62 2 61 2 60 2 59 2 58 2 57 2 56 2 55 2 54 2 53 2 52 2 51 2 50 2 49 2 48 2 47 2 46 2 45 2 44 2 43 2 42 2 41 2 40 2 39 2 38 2 37 2 36 2 35 2 34 2 33 2 32 2 31 2 30 2 29 2 28 2 27 2 26 2 25 2 24 2 23 2 22 2 21 2 20 2 19 2 18 2 17 2 16 2 15 2 14 2 13 2 12 2 11 2 10 2 9 2 8 2 7 2 6 2 5 2 4 2 3 ...
result:
ok good solution!
Test #79:
score: 0
Accepted
time: 5ms
memory: 3960kb
input:
297 BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAAB
output:
148 147 2 146 2 145 2 144 2 143 2 142 2 141 2 140 2 139 2 138 2 137 2 136 2 135 2 134 2 133 2 132 2 131 2 130 2 129 2 128 2 127 2 126 2 125 2 124 2 123 2 122 2 121 2 120 2 119 2 118 2 117 2 116 2 115 2 114 2 113 2 112 2 111 2 110 2 109 2 108 2 107 2 106 2 105 2 104 2 103 2 102 2 101 2 100 2 99 2 98 ...
result:
ok good solution!
Test #80:
score: 0
Accepted
time: 5ms
memory: 4188kb
input:
297 ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA
output:
148 147 2 146 2 145 2 144 2 143 2 142 2 141 2 140 2 139 2 138 2 137 2 136 2 135 2 134 2 133 2 132 2 131 2 130 2 129 2 128 2 127 2 126 2 125 2 124 2 123 2 122 2 121 2 120 2 119 2 118 2 117 2 116 2 115 2 114 2 113 2 112 2 111 2 110 2 109 2 108 2 107 2 106 2 105 2 104 2 103 2 102 2 101 2 100 2 99 2 98 ...
result:
ok good solution!
Test #81:
score: 0
Accepted
time: 5ms
memory: 3924kb
input:
297 ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAABAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA
output:
148 147 2 148 2 146 3 145 2 144 2 143 2 142 2 141 2 140 2 139 2 138 2 137 2 136 2 135 2 134 2 133 2 132 2 131 2 130 2 129 2 128 2 127 2 126 2 125 2 124 2 123 2 122 2 121 2 120 2 119 2 118 2 117 2 116 2 115 2 114 2 113 2 112 2 111 2 110 2 109 2 108 2 107 2 106 2 105 2 104 2 103 2 102 2 101 2 100 2 99...
result:
ok good solution!
Test #82:
score: 0
Accepted
time: 2ms
memory: 3904kb
input:
298 ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA
output:
148 87 2 148 3 147 2 146 2 145 2 144 2 143 2 142 2 141 2 140 2 139 2 138 2 137 2 136 2 135 2 134 2 133 2 132 2 131 2 130 2 129 2 128 2 127 2 126 2 125 2 124 2 123 2 122 2 121 2 120 2 119 2 118 2 117 2 116 2 115 2 114 2 113 2 112 2 111 2 110 2 109 2 108 2 107 2 106 2 105 2 104 2 103 2 102 2 101 2 100...
result:
ok good solution!
Test #83:
score: 0
Accepted
time: 5ms
memory: 3968kb
input:
300 ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBBBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA...
output:
149 88 3 87 2 86 2 85 2 84 2 83 2 82 2 81 2 80 2 79 2 78 2 77 2 76 2 75 2 74 2 73 2 72 2 71 2 70 2 69 2 68 2 67 2 66 2 65 2 64 2 63 2 62 2 61 2 60 2 59 2 58 2 57 2 56 2 55 2 54 2 53 2 52 2 51 2 50 2 49 2 48 2 47 2 46 2 45 2 44 2 43 2 42 2 41 2 40 2 39 2 38 2 37 2 36 2 35 2 34 2 33 2 32 2 31 2 30 2 2...
result:
ok good solution!
Test #84:
score: 0
Accepted
time: 0ms
memory: 3968kb
input:
300 ABBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAABAABBAABBAABBAABBAABBAAABBAABBAAABBAABBAAABBAABBAABBAABBAABBAABBBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBBAABBAABBAABBAABBAABBBAABBAABBAABBAABB...
output:
106 2 2 1 2 96 2 95 2 94 3 93 3 92 3 91 3 90 3 89 3 88 3 87 3 86 3 85 3 84 2 84 2 83 3 82 3 81 3 80 2 80 2 79 3 78 3 77 3 76 2 76 2 75 3 74 3 73 3 72 3 71 3 70 3 69 3 68 3 67 3 66 3 65 2 65 2 64 3 63 3 62 3 61 3 60 3 59 3 58 3 57 3 56 3 55 3 54 3 53 3 52 3 51 3 50 3 49 3 48 3 47 3 46 3 45 3 44 3 43 ...
result:
ok good solution!
Test #85:
score: 0
Accepted
time: 2ms
memory: 3900kb
input:
299 BBABBAABBAABBAABBAABBAABBAABBAABBAABBBAABBAABBBAABBAABBAABBAABBAAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBBAABBAABBAABBAABBAABBAABBBAABBAABBAABBAABAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...
output:
105 1 2 2 2 1 2 30 2 37 2 54 2 147 2 170 2 186 2 185 2 183 3 181 3 179 3 177 3 175 3 173 3 171 3 170 2 168 3 166 3 164 3 162 3 160 3 158 3 156 3 154 3 152 3 150 3 148 3 147 2 145 3 143 3 141 3 139 3 137 3 135 3 133 3 131 3 129 3 127 3 125 3 123 3 121 3 119 3 117 3 115 3 113 3 111 3 109 3 107 3 105 3...
result:
ok good solution!
Test #86:
score: 0
Accepted
time: 2ms
memory: 4196kb
input:
299 AABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBABABABABABABABABABABABABABABABABABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAAABBAABBBAABBAABBAABBAABBAABBAABBAABBAABBAABAABBAABBBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBBAABBAABBAABBA...
output:
134 1 2 65 2 64 2 63 2 62 2 61 2 60 2 59 2 58 2 57 2 56 2 55 2 54 2 53 2 52 2 51 2 50 2 49 2 48 2 47 2 46 2 45 2 44 2 43 2 42 2 41 2 40 2 39 2 38 2 37 2 36 2 35 2 34 2 33 2 32 2 31 3 30 3 29 3 28 3 27 3 26 3 25 3 24 3 23 3 22 3 21 3 20 3 19 3 18 3 17 3 16 3 15 3 14 3 13 3 12 3 11 3 10 3 9 2 9 2 8 3 ...
result:
ok good solution!
Test #87:
score: 0
Accepted
time: 0ms
memory: 3960kb
input:
299 BAABBBAABBAABBAABBAABBAABBAABBBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAAABBAABBAABBAABBAABBAABBAABBAAABBAABBAABBAAABBAABBABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAABABABABABABABABABABABABABABAB...
output:
133 2 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 3 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 3 1 2 2 2 1 2 2 2 1 2 2 3 1 2 2 2 1 2 3 2 2 2 63 2 61 3 59 3 57 3 55 3 53 ...
result:
ok good solution!
Test #88:
score: 0
Accepted
time: 3ms
memory: 4124kb
input:
300 AAABBAABBAABBAABBAABBAABBAABBAABBBAAABBAABBAABBAABBAAABBAABBAABBAABBAABBAAABBAABBAABBAABBAABBBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...
output:
106 1 2 2 2 1 2 26 2 27 2 42 2 61 2 78 2 182 2 181 2 179 3 177 3 175 3 173 3 171 3 169 3 167 3 165 3 163 3 161 3 159 3 157 3 155 3 153 3 151 3 149 3 147 3 145 3 143 3 141 3 139 3 137 3 135 3 133 3 131 3 129 3 127 3 125 3 123 3 121 3 119 3 117 3 115 3 113 3 111 3 109 3 107 3 105 3 103 3 101 3 99 3 97...
result:
ok good solution!
Test #89:
score: 0
Accepted
time: 3ms
memory: 3912kb
input:
300 BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAABAABBAABBAABBAABBBAABBAABBAABBAAABBAABBAABBAAABBAABBBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAAABBAABBAABBAABBAABBBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABB...
output:
106 96 2 95 2 94 3 93 3 92 3 91 3 90 3 89 3 88 3 87 2 87 2 86 3 85 3 84 3 83 3 82 3 81 3 80 2 80 2 79 3 78 3 77 3 76 3 75 3 74 2 74 2 73 3 72 3 71 2 71 2 70 3 69 3 68 3 67 3 66 3 65 3 64 3 63 3 62 3 61 3 60 3 59 3 58 3 57 3 56 3 55 3 54 3 53 3 52 3 51 3 50 3 49 3 48 3 47 3 46 3 45 3 44 3 43 3 42 2 4...
result:
ok good solution!
Test #90:
score: 0
Accepted
time: 4ms
memory: 3988kb
input:
299 BBAABBAABBAABBAABBAABBAABBAABBAAABBAABBAABBAABBAABBAABBBAABAABBAABBAABBAABBAABBAABBBAABBAABBAABBAABBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABBABABABABABABABABABABAABBAABBAABBAABBAABBAABBAABBAAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABB...
output:
121 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 3 1 2 3 2 2 3 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 17 2 15 3 13 3 11 3 9 3 7 3 5 3 3 3 2 2 1 2 69 2 68 2 67 2 66 2 65 2 64 2 63 2 62 2 61 2 60 2 59 2 58 2 57 2 56 2 55 2 54 2 53 2 52 2 51...
result:
ok good solution!
Test #91:
score: 0
Accepted
time: 1ms
memory: 3900kb
input:
300 ABABABABABABABABABABABABABABAABABABABABABABABABABABBAABBBAABBAABBAABBBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBBAABBAABBAABBBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBABBAABBAABBAABBAABBAAABBAAABBAABBAABBAABBAABABABABABABABABABABABABABABABABABABABABABABAB...
output:
122 29 2 28 2 27 2 26 2 25 2 24 2 23 2 22 2 21 2 20 2 19 2 18 2 17 2 16 2 15 2 14 2 13 2 12 2 11 2 10 2 9 2 8 3 7 3 6 2 6 2 5 3 4 3 3 3 2 3 1 2 2 3 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 3 1 2 2 2 1 2 2 2 1 2 2 3 ...
result:
ok good solution!
Test #92:
score: 0
Accepted
time: 5ms
memory: 3920kb
input:
298 ABABABABABABABABABABABABABABABABAABABABABABABABABAAAAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAAAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB
output:
148 33 2 48 2 48 3 47 2 46 2 45 2 44 2 43 2 42 2 41 2 40 2 39 2 38 2 37 2 36 2 35 2 34 2 32 3 31 2 30 2 29 2 28 2 27 2 26 2 25 2 24 2 23 2 22 2 21 2 20 2 19 2 18 2 17 2 16 2 15 2 14 2 13 2 12 2 11 2 10 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 98 2 98 2 97 2 96 2 95 2 94 2 93 2 92 2 91 2 90 2 89 2 88 2 ...
result:
ok good solution!
Test #93:
score: 0
Accepted
time: 2ms
memory: 3892kb
input:
300 ABABABABABABABABABABABABABABABABABABABABABABABABAAAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAAAAABABABABABABABABABABABABABABABABABBBBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...
output:
149 49 2 49 2 48 2 47 2 46 2 45 2 44 2 43 2 42 2 41 2 40 2 39 2 38 2 37 2 36 2 35 2 34 2 33 2 32 2 31 2 30 2 29 2 28 2 27 2 26 2 25 2 24 2 23 2 22 2 21 2 20 2 19 2 18 2 17 2 16 2 15 2 14 2 13 2 12 2 11 2 10 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 96 2 96 3 95 2 94 2 93 2 92 2 91 2 90 2 89 2 88 2 87 2 ...
result:
ok good solution!
Test #94:
score: 0
Accepted
time: 5ms
memory: 3900kb
input:
298 ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAAAAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB
output:
147 59 2 59 3 58 2 57 2 56 2 55 2 54 2 53 2 52 2 51 2 50 2 49 2 48 2 47 2 46 2 45 2 44 2 43 2 42 2 41 2 40 2 39 2 38 2 37 2 36 2 35 2 34 2 33 2 32 2 31 2 30 2 29 2 28 2 27 2 26 2 25 2 24 2 23 2 22 2 21 2 20 2 19 2 18 2 17 2 16 2 15 2 14 2 13 2 12 2 11 2 10 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 12 3 ...
result:
ok good solution!
Test #95:
score: 0
Accepted
time: 5ms
memory: 4196kb
input:
300 ABABABABABABABABABABABABABABABBBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAAAAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAAAAABABABABABABABABABABABABABABABABABABABABABABABABABABAB...
output:
148 30 3 29 2 28 2 27 2 26 2 25 2 24 2 23 2 22 2 21 2 20 2 19 2 18 2 17 2 16 2 15 2 14 2 13 2 12 2 11 2 10 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 60 2 60 3 59 2 58 2 57 2 56 2 55 2 54 2 53 2 52 2 51 2 50 2 49 2 48 2 47 2 46 2 45 2 44 2 43 2 42 2 41 2 40 2 39 2 38 2 37 2 36 2 35 2 34 2 33 2 32 2 31 2 30 2...
result:
ok good solution!
Test #96:
score: 0
Accepted
time: 3ms
memory: 3744kb
input:
299 AABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAAB...
output:
-1
result:
ok no solution
Test #97:
score: 0
Accepted
time: 5ms
memory: 3676kb
input:
300 AABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAA...
output:
-1
result:
ok no solution
Test #98:
score: 0
Accepted
time: 3ms
memory: 3884kb
input:
299 BBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA...
output:
-1
result:
ok no solution
Test #99:
score: 0
Accepted
time: 2ms
memory: 3740kb
input:
300 BBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA...
output:
-1
result:
ok no solution
Test #100:
score: 0
Accepted
time: 3ms
memory: 3724kb
input:
300 BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAAABBAABBAAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAAABBAABBAABBAA...
output:
-1
result:
ok no solution
Test #101:
score: 0
Accepted
time: 5ms
memory: 3720kb
input:
300 BBAABBBAABBAABBAABBAABBAABBAABBAABBAAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABBAABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAABBAABBAABBAABBAABBAABBAAABBAABBAABBAABBAABBAABBAABBAABBAABBAA...
output:
-1
result:
ok no solution
Subtask #3:
score: 0
Time Limit Exceeded
Test #102:
score: 0
Time Limit Exceeded
input:
5998 BABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...
output:
result:
Subtask #4:
score: 0
Time Limit Exceeded
Test #153:
score: 0
Time Limit Exceeded
input:
999997 ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABA...