QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#759475 | #6611. United in Stormwind | fosov | AC ✓ | 221ms | 24156kb | C++14 | 1.6kb | 2024-11-18 09:06:10 | 2024-11-18 09:06:18 |
Judging History
answer
#include "bits/stdc++.h"
using namespace std;
#define ll long long
#define lll __int128
#define INF 0x3f3f3f3f
#define LNF 0x3f3f3f3f3f3f3f3fll
#define MOD 998244353
#define pii pair<int, int>
#define N (1<<21)
template<typename T>
struct FWT {
int n;
void Xor(T* a, bool inv=0) {
T t = !inv ? T(1) : T(2);
for (int i = 2; i <= n; i <<= 1) {
int h = i >> 1;
for (int j = 0; j < n; j += i) {
for (int k = 0; k < h; ++ k) {
a[j+k] = a[j+k] + a[j+k+h];
a[j+k+h] = a[j+k] - a[j+k+h] - a[j+k+h];
a[j+k] = a[j+k] / t;
a[j+k+h] = a[j+k+h] / t;
}
}
}
}
};
FWT<ll> fwt;
ll cnt[N], dp[N];
int main() {
#ifdef TEST
freopen("zz.in", "r+", stdin);
#endif
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll n, m, k; cin >> n >> m >> k;
int msk = (1<<m)-1;
for (int i = 0; i < n; ++ i) {
string s; cin >> s;
int cur = 0;
for (int j = 0; j < m; ++ j) cur |= ((s[j] == 'A') << j);
cnt[cur] ++;
}
fwt.n = 1<<m;
fwt.Xor(cnt);
for (int i = 0; i < (1<<m); ++ i) cnt[i] *= cnt[i];
fwt.Xor(cnt, 1);
for (int i = 0; i < (1<<m); ++ i) dp[i] = cnt[i];
for (int i = 0; i < m; ++ i) {
for (int j = 0; j < (1<<m); ++ j) {
if ((j>>i)&1) {
dp[j] += dp[j^(1<<i)];
}
}
}
int res = 0;
for (int i = 1; i < (1<<m); ++ i) res += (n * n - dp[msk^i]) >= 2 * k;
cout << res << '\n';
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 5804kb
input:
2 2 1 AA BB
output:
3
result:
ok 1 number(s): "3"
Test #2:
score: 0
Accepted
time: 1ms
memory: 5624kb
input:
2 2 1 AA AB
output:
2
result:
ok 1 number(s): "2"
Test #3:
score: 0
Accepted
time: 1ms
memory: 5568kb
input:
5000 10 12302135 AABAAAABBA AAABAABBAB BAABABAAAB ABBAABBBBA BAAAAABAAB BABBAAAAAA BABBABABAB BBABBAAAAB BABBABBBBA AAAAAAABAA BBBBBAABBA BAABABBAAB BABAAABAAA AAAAABAABB BBABAABABB ABAABBABBA BBBAAABABA BAAABABBAB ABAAAAABAA AABBBBBBAA ABBABBABBA AABBBABBAB BAABBAAABB BAAABBBBBB ABABBAABBB BABBABBA...
output:
300
result:
ok 1 number(s): "300"
Test #4:
score: 0
Accepted
time: 1ms
memory: 5624kb
input:
5000 10 1 AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABBAABBBB AABB...
output:
0
result:
ok 1 number(s): "0"
Test #5:
score: 0
Accepted
time: 1ms
memory: 5560kb
input:
5000 10 8968133 BABAAAAAAA BABAAAAAAA AAABAAAAAA BABBBBBAAA AABBAAABAA AAABAAAAAA ABAAABAAAB BABBBBBAAA BABAAAAAAA BABBBBBAAA ABAAABAAAB BABAAAAAAA ABAAABAAAB AABBAAABAA AAABAAAAAA BABAAAAAAA AAABAAAAAA BABBBBBAAA BABBBBBAAA BABAAAAAAA BABAAAAAAA AABBAAABAA AABBAAABAA AAABAAAAAA AAABAAAAAA AAABAAAAA...
output:
886
result:
ok 1 number(s): "886"
Test #6:
score: 0
Accepted
time: 1ms
memory: 5624kb
input:
5000 10 10507302 BBBAABAAAB BBBAABAAAB ABAABAAAAA BBBABBAAAA ABBABABBAB ABBABABBAB BBBABBAAAA BBBABBAAAA AABAABBABA ABBABAAABB ABBABAAABB ABAABAAAAA BBABBABBAB BAABBAABAA BAABBBAAAA BABBBABAAB ABBABAAABB BAABBAABAA BBABBABBAB BBABBABBAB ABAABAAAAA ABBABABBAB ABAABAAAAA ABBABAAABB AABAABBABA BBABBABB...
output:
755
result:
ok 1 number(s): "755"
Test #7:
score: 0
Accepted
time: 0ms
memory: 5632kb
input:
5000 10 10810288 BBBAAABBBB BBBBBAAAAB BBBABAABBB BBBBABBBBA BBBBABBBBA AAAAAABAAA BBAAABBABB AAABBABAAB AAABBBAABB ABBBBBABBA ABABABBBBA AABBABBBAA AAABAABBAB BBBAABBBAA AAABAABBAA BBAABBBAAA ABBAABABBB BBAABBBAAA BAABBBBABA BBBBBABABA AABABABAAA BABBBBBAAB BBABBABAAB AAABAABBAA BBBBABBBBA AAABAAAB...
output:
870
result:
ok 1 number(s): "870"
Test #8:
score: 0
Accepted
time: 0ms
memory: 5816kb
input:
5000 10 12280385 ABABAAABBA ABBBBABBAB AABBBBAABA BBBABAABAA AAAAABABAA BBBBABAAAA BBAAAABBBA ABABBABAAB ABABAABBAB BAAABAAAAB AAAABBBABA BABBBAABAA ABBBBBBAAB ABBBABBABA BBAABAABAA ABABBBAABB ABBBBBAAAB BBBAABBAAB BBBBBAABBB BBBABAABAB ABAAAAABBB AAAAABABAA BBAAAAABBA BAAABBABAB BABBBBBABA ABAAABAB...
output:
141
result:
ok 1 number(s): "141"
Test #9:
score: 0
Accepted
time: 0ms
memory: 5632kb
input:
5000 10 12436636 ABABABAABB ABAABAAABA BBBBAAABAB BABAAABAAB BBABABAABB ABAABAAABB ABBAAAABAB BAAAABBBBB ABABAAAABB BAABAAABBA AAAAAAABAA BAAABBABAB BAAABBBABA AAAABBBBAA AABBBAABBA BBBAAAABAB BBBBAABBBB AABABBBBBA ABABBBAABB BBAABBABBA ABAABABABA BBBBAAABAB BBBBBAAAAA AAABABAAAB ABABAAAAAA AABBABAB...
output:
28
result:
ok 1 number(s): "28"
Test #10:
score: 0
Accepted
time: 0ms
memory: 5632kb
input:
5000 10 9373047 ABABAAABBB BABBAABABB ABABAAAAAB ABBBAAAABA ABBBAABABB AABBBBBABB AAABAAABAB ABAABBBBAB ABAAAABAAB BBABBBBBAA AABAAAAABB BAAAAAAABA BAABBABBBB BABAABABBB ABBBAABABB ABBAAAAABB BABBBABBAB ABAAABABAB AABBBABAAA AAABAAAAAB AABBAABABB BBBBAAAAAB AAABBAABBA ABABABABBB AABBBBBBAB AAABAAABB...
output:
999
result:
ok 1 number(s): "999"
Test #11:
score: 0
Accepted
time: 201ms
memory: 22996kb
input:
5000 20 12473302 AAAABBABAABBBABABBAB ABAABAAAABAABBABBABA ABBBAABABABABBBAAAAB BBABABBBAAAAAAABABAA BAABBBBAABBBBABABBBB BABBBABBBAAABABAAABB BAAAABAABBABAABBABBA ABBAABAAABABABBABBBA AABAABABAABAABAABBBA BBBABABAABBAABAAAABA BBBBBABAAABBBBBABBBB BBAAAAAAAAABBABBBABA ABBAAAABABAAAAABBBBB BBAABBABAB...
output:
635417
result:
ok 1 number(s): "635417"
Test #12:
score: 0
Accepted
time: 142ms
memory: 22020kb
input:
5000 20 1 AAABABAABABBAABBBBAA AAABABAABABBAABBBBAA AAABABAABABBAABBBBAA AAABABAABABBAABBBBAA AAABABAABABBAABBBBAA AAABABAABABBAABBBBAA AAABABAABABBAABBBBAA AAABABAABABBAABBBBAA AAABABAABABBAABBBBAA AAABABAABABBAABBBBAA AAABABAABABBAABBBBAA AAABABAABABBAABBBBAA AAABABAABABBAABBBBAA AAABABAABABBAABBB...
output:
0
result:
ok 1 number(s): "0"
Test #13:
score: 0
Accepted
time: 151ms
memory: 23384kb
input:
5000 20 9998760 ABABBAABBBABAAAABBAB BBBABAABAABAAABAAAAA BBBABAABAABAAABAAAAA ABAAAAAAABAABAAABAAB BBBABAABAABAAABAAAAA ABAAAAAAABAABAAABAAB BBBABAABAABAAABAAAAA ABAAAAAAABAABAAABAAB BBBABAABAABAAABAAAAA BBBABAABAABAAABAAAAA ABABBAABBBABAAAABBAB ABBBBABBBAAAAAAAAABA ABBBBABBBAAAAAAAAABA BBBABAABAAB...
output:
1023376
result:
ok 1 number(s): "1023376"
Test #14:
score: 0
Accepted
time: 181ms
memory: 21368kb
input:
5000 20 11247826 BBAAABBABBABAABABAAA BAABABBAABBBBAAAABBA AAAAABABAAABAABAABBA BBBBBABAAABABBBBAAAA BBBBBABBBABABABBBABA BBBBBABBBABABABBBABA BABBAAABBBBAABABAABA AABBAAABABABAABBBBBA BBAAABBABBABAABABAAA BBBABBBAABABBBAAAABB BAABABAAAABBBABBBBAA BBBABBBAABABBBAAAABB BAABABBAABBBBAAAABBA AABBAAABAB...
output:
929006
result:
ok 1 number(s): "929006"
Test #15:
score: 0
Accepted
time: 200ms
memory: 23372kb
input:
5000 20 12248582 ABABABABABBBAABAAABA BBBABABABBABBBBBAABA BAAAAAAABABBBBBBBABB BAAABAAAAAAAABAABABB BAABBBAABBABABBBBAAB BBAABABBBAABBBAAABAA BABABBABABBBABABABAB BBBBABBBBAABABBAAAAA ABBBBBBBBABBABBBBAAB AABBBBBABBBABBBAAAAA ABABAAABABBBAABAABBA BBABABAAABBABAAABABA BBBBBAABBABBBBBBAAAB AAABAAABBA...
output:
342770
result:
ok 1 number(s): "342770"
Test #16:
score: 0
Accepted
time: 189ms
memory: 21940kb
input:
5000 20 12315136 ABBBABABBABBAABBBAAA BAAAABAABAABAABBABAA BBBABBBBABBBBABBBBAB AAABAABBAAAABBAAABAB AABBABBBBAAAABABAAAA BBABBBBAAABBBBAAABBB ABAAABAABAAAABABBBAA BABBBBBABABAAABAABAB AAABAABABBABBAAAAAAB ABABBABBAABBBAAABABA BAABBAAABBBAABABBBAA BAABBBAAAAAABABBBAAB AAABABBAAABABBBABBBA AAABAABBAA...
output:
891051
result:
ok 1 number(s): "891051"
Test #17:
score: 0
Accepted
time: 207ms
memory: 22876kb
input:
5000 20 12460867 AABBABBAAABABABABABA ABAABBBABAAAABAABABB ABAABAAABAABABAABAAA AABABBABBAABABBAABBB BAABBAABABBABBABBBBA BBBABABAAABBBAABBABA BABABBAABBABAAAABABB BABBBABBBBAABAABBABA BABABBABAAABBAABABAA AABAABBBABBAABBABABB AABBBABBBBABABBAAAAA BBBBBABBBABBBBBAABBA ABABAABBAAAAAABAAABB AABBBABAAA...
output:
487621
result:
ok 1 number(s): "487621"
Test #18:
score: 0
Accepted
time: 206ms
memory: 23840kb
input:
5000 20 12482845 BBBBAABABBBAAAAAABBA BBBAAAABBABBABBAABAA BABABBBBBAAAAABBBAAB AABAAABABAAABBAAABAA AAAAABAABAAABBAAABBA ABBBAAABAAAAAAAAAAAB ABABBABABABBBAAAAAAB BBABBABABBBAABBBABBA BBAAABBAAABABBBBAABB ABBAABABAABBAABABABA BBBAABABABBBBBABAABA AABAAAAAAAAABAAABBBA BAAAABABBBABAAAABABA BAAAAABBBA...
output:
148743
result:
ok 1 number(s): "148743"
Test #19:
score: 0
Accepted
time: 203ms
memory: 24156kb
input:
5000 20 12302677 BBAABBBAAAAABAAAAAAB AABBBAAAAABAAABBAAAB AABABAABBBAAAABAAABB BBBBBABAABAAAAAABBBA AABBAAAAABBAABABABBB BBAABAAABABBBBBAABAB BBAAABAAABBBBBAABBBA BBABBAABAABBABBABBAA ABABBABABBBAAABBBBBB BAABBAABBBAABBBAAABB ABBBBAABBABBBAAABBBA AAABABAAAAAAABBBAABB AAAABBBBAABBBBABBBAA AAABBBAAAA...
output:
993237
result:
ok 1 number(s): "993237"
Test #20:
score: 0
Accepted
time: 5ms
memory: 5544kb
input:
200000 1 9999998911 A B B A B B A A A B B B B B A B B A B B A A A A B B A A A B A B B A A B B B A A A B A A A B A A B A B B B A A B B B A B B A A B B A B B B A A B B A B A A B A A A B A B B B A B A B B B B A A B A B B B A B A A B B B B B A A B B A A B A B A B A B B A B B A A B B B A B A A B B B B B ...
output:
1
result:
ok 1 number(s): "1"
Test #21:
score: 0
Accepted
time: 5ms
memory: 5656kb
input:
200000 2 1 BB BA BB AB BB BB BA BA AB BA AB BA AB AB AA BA BB AA BA BB AB AB AB AB BA BB BA AA AA AB BB AA AA BB BB BA AB AA AB AB AA AB BA AA BA AA AB BB AA BB BB BA BA BA AB AB AA BA BB AB AA BA BA AB BA BA BA BB BB BA BA BA AA AB AB AB AB BA AB BA BB AB BB BB AB BB BB BA BA BB AB AA AB AA BB BB A...
output:
3
result:
ok 1 number(s): "3"
Test #22:
score: 0
Accepted
time: 5ms
memory: 5492kb
input:
200000 3 14999990279 ABB BBA BAA BBA AAA AAB BBA BAA BBB BBB BAB ABB BAA BBB BAB BBB BBB BBA ABA BAB BAA BBB ABA BAB AAA BAA BAA BAA BBA AAB BAA ABB BBA AAA BAB AAB ABB AAA AAB BAA BBB ABA BAB ABB AAB BBA BAB AAA BBB BAA ABA AAA ABB BBB AAB AAB AAB AAB ABB AAB BAB AAB ABA BAB ABB BAB ABA ABA ABA AAB...
output:
2
result:
ok 1 number(s): "2"
Test #23:
score: 0
Accepted
time: 5ms
memory: 5508kb
input:
200000 4 14999997039 BAAB BABA AABA BBAA BAAA BABB ABBB AAAB AAAA BABA AAAB ABAA AABA AABB BBBA AAAB AABB BBAA BBBA BBBA BABB BBBB ABBA BABB AAAA ABAB ABBA BBBB BAAA ABAA ABBB BBAA ABAA BAAB ABAB BBBA ABBA BBAA BBBA AAAB ABBA BBAB AAAB AABB BBBB ABBB AABA BAAB ABAA ABBB BABA BBAB BBAA AAAA ABAB ABAA...
output:
7
result:
ok 1 number(s): "7"
Test #24:
score: 0
Accepted
time: 6ms
memory: 5808kb
input:
200000 5 17499883577 BBAAA ABBBB ABBAB AABBA ABABA BABAB BAABA BBBBB ABABB AABAA BBAAA ABBAB BBBBA BAABA BAAAB ABAAB AAABA BBABA AABAA BAABB AAABA AAAAB ABAAB BABAB BBBAB AABAA ABAAB AABAB AAAAA BAABB AABAA BAABA BAAAB ABAAA BBBAA BAABA BABBB ABBAB BAAAA AAAAB BABBB BBAAB BBABB ABABB BBABA BAABB ABA...
output:
12
result:
ok 1 number(s): "12"
Test #25:
score: 0
Accepted
time: 3ms
memory: 5620kb
input:
200000 6 19687442613 ABBBAB AAABBB AAABAA AABABB ABAAAB ABBBBA AABAAA BBBABA BBAAAA ABAABA ABBBBA ABABAA ABABAA ABBABB ABABAA AABBBB AABAAA ABAAAB BAAABA BBABAA AABABA AAAAAB BABBAA AABBAA BBBBAB ABBBAB BBBBAB ABABAA ABBBBA BBBBBB BAABBB BBBBBB AAAAAA ABABBB AABAAA AABBBA BABAAA ABABBB AABBBB BBBAAA...
output:
1
result:
ok 1 number(s): "1"
Test #26:
score: 0
Accepted
time: 6ms
memory: 5852kb
input:
200000 7 14999854317 BAABBBA ABAABBA ABABBAA AABBBAB BBABBAA BBBAAAA ABBBBBB ABBBABB AABBAAA AAAAABB BAABBBA BBBBBBB BABAAAA AABAAAB AABAABA BABAAAB BAAAABB ABABBBA ABBBBBA BABBBBA AAAAABB AAAABAB BAABABA AABAABA ABBAABA AAABBAA AABBABA BBBBBBB BABBBBA ABBAABA BBBBABA AABABAA BBBBAAA BBAABAA ABAAAAB...
output:
118
result:
ok 1 number(s): "118"
Test #27:
score: 0
Accepted
time: 7ms
memory: 5852kb
input:
200000 8 17499967620 AABAAABA AABBABAB BABBABBB BABAAABA AABABABB BBBBABBB BAABBBBA ABBAAABA ABBABABB BBBBABBB AABABABB BBAABBAA AAAAAAAA BAAABABB ABBBBBBA BBBBAAAA BABBBBAA ABAABAAA BBABABBA BBBBABBA BBABABAA BAAAAAAA BABAAAAB AABBBBBB ABBBBAAB ABAAAABA AAABABAA AABABBBB BBABBAAA AABBAABA AABAABAB ...
output:
171
result:
ok 1 number(s): "171"
Test #28:
score: 0
Accepted
time: 7ms
memory: 5852kb
input:
200000 9 19687407472 BBBBAABAB BABAABABA BBBBBBABA BABBABABB BABBAAABA AAABBABAA AABABBBBA BABBBAABB BBBBBAAAA BABBBBBAA BBBBABBBA BBBAABBAA BBABBBBBB ABBBBABBB BBBABABBA AAABBABAB BAABBAABB BAABABBAA BAABBAABA BAAAABAAB BBBABBBAA BAAABBABB BAAAABBAA AABABABAA BABABAABA BBABABBAB BABAABAAB ABABABBBB...
output:
96
result:
ok 1 number(s): "96"
Test #29:
score: 0
Accepted
time: 3ms
memory: 5816kb
input:
200000 10 17499854307 ABAABBBAAA AAAAAABAAB BAAAABBABB ABAAAABAAB BBAABABBAB BBABAABABB BAABAABBBA ABBAABBBBA ABABBBBAAA BAAAABAABA BBAAAABAAA BABAABABBA BBABBABBAB BBBAAAAAAB ABABAABBAA AABBBABAAA BBABBAAABB ABAABAAABA AAAABABAAA BABBBBBBAB BABABAABAA AAAABBABAA BAABBBAABA ABBBAAAABB BAABBABABB AAA...
output:
965
result:
ok 1 number(s): "965"
Test #30:
score: 0
Accepted
time: 7ms
memory: 5556kb
input:
200000 10 1 BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BBABBABABB BB...
output:
0
result:
ok 1 number(s): "0"
Test #31:
score: 0
Accepted
time: 0ms
memory: 5568kb
input:
200000 10 15999912512 BABBAAABAA BAAAAAAABB BAABBBBABB BAABBBBABB BAABBBBABB AAABAABBBB BABBAAABAA BABBAAABAA BAAAAAAABB BABBABBAAA BABBAAABAA BABBAAABAA AAABAABBBB BABBABBAAA AAABAABBBB AAABAABBBB AAABAABBBB BABBAAABAA BABBAAABAA BABBABBAAA BABBABBAAA BABBAAABAA BAAAAAAABB AAABAABBBB BABBABBAAA BAB...
output:
730
result:
ok 1 number(s): "730"
Test #32:
score: 0
Accepted
time: 7ms
memory: 5624kb
input:
200000 10 17197467436 AABABAAABA BAABAAABBA ABAAABABAB BAABABAAAA AABABABAAB ABAAABABAB BAABAAABBA ABBAABBABA ABAAABABAB ABBAABBABA BAABAAABBA ABBABABBBB BAABAAABBA AABABAAABA AABABABAAB BAABAAABBA AABBABBABA AABABABAAB ABABABBBAB AABABAAABA BABBBBABAB BABBBBABAB AABABABAAB ABAAABABAB ABABABBBAB BAB...
output:
768
result:
ok 1 number(s): "768"
Test #33:
score: 0
Accepted
time: 7ms
memory: 5556kb
input:
200000 10 19376668500 ABBBABBBBA BAAAABABBB BBAABBABBA BBABAABBBB ABBBABBAAA ABBBABBBBA BBBBAABBAA BABBBAABBB ABBBABBBBB ABBBABBAAA ABBAABABAA AAAABAABBB ABAAABAAAA BBABAAABBB ABBABBABBB BBBBBBABAB AAAAAABAAA AABBABBAAA ABABABBABB ABBBABBBBB ABBBABBBBA AAAABAAAAA ABBABABAAA ABABABBABB BAAAABABBB BAA...
output:
201
result:
ok 1 number(s): "201"
Test #34:
score: 0
Accepted
time: 3ms
memory: 5784kb
input:
200000 10 18587084437 BBABBABABA AABBABABAB BBAABBABBB ABAABBABAA BBBBBBAABA AABBAAABAA BABBAABABB BABBABAABA BABBBABAAB BAAABBAAAA ABABAABABB BBBAABBABA BAABABABBA ABBBAABABA BBABAAABBA BAABABABBA ABABBAAAAB BAAABBAAAA BAABBAAABB BAABABBAAA BBAAABAABA BBBBAABBBB BBABBABABA BABAAABAAB BAAAABABAB BBA...
output:
697
result:
ok 1 number(s): "697"
Test #35:
score: 0
Accepted
time: 7ms
memory: 5588kb
input:
200000 10 19669942496 ABAABBBBBB AABBBBABAA ABAABBABAB ABBAAABBBB BAAABAABBA AABAAAABAB BBAABBABAA BAABBBBABB BABAAABABA ABAAAAABBA ABAABBABBA BABABBBAAA BBBAAAAAAA BBBBBBBABA BABBABBBAA AABABBBABB BBAAAAAABA AAABAAAAAA BAABBABAAA BAAAABABBA AAABBABAAA AAABBBBAAA ABAABABBAB ABBBAABBAB AABAAABBAB BBB...
output:
198
result:
ok 1 number(s): "198"
Test #36:
score: 0
Accepted
time: 0ms
memory: 5572kb
input:
200000 10 18749762838 AABBABABBA AABABABABB BBABBBBBBA AABBABBBBB BBAABAAABB BAAAAAABAB ABABABBBAA ABBBAAABBA ABBBAAABBB AAAABABAAA AAABBBAAAA AABBAAABBA AAAABBABAA BBABBABABA AABBBBAAAA AAAABAABAB BBBAAAAABA BBBBBABABA AABABBAAAA AABABAAAAA AAAAABBBBA AABAABABAA BABBAABBBA AAAAAAABBB AABBABAABA BBA...
output:
641
result:
ok 1 number(s): "641"
Test #37:
score: 0
Accepted
time: 7ms
memory: 5584kb
input:
200000 11 19374883366 BABBBBBABAA ABABBBAABBA AABABBAAABB ABABABABABB AABBAAABABB AABABBABBAB AABAAABAAAA BABBBBAABBB AABAAABBBBB AAAABBABBBB ABBBBABAABA BAABBABBABB ABBABABBAAA AABABAAAAAA BBAAABAAABB ABBAABABAAA BBBABBBAABB ABABABBAAAA BABBBBBAABA BBBBABABAAA BAAAABBBABA AAAAABBABAB AABABAAAAAA AB...
output:
1402
result:
ok 1 number(s): "1402"
Test #38:
score: 0
Accepted
time: 8ms
memory: 5580kb
input:
200000 12 17499945718 AAABAAABABBB AABABBAAAAAA ABBAAAAABABA ABAABAAABBBB AABAAABAABBA AABBBAAAAABA BBBBBBABABBA BABABAABAABA BABBAAAABBBB ABBBBBAAABAB BAABBBBAAAAB ABBBAAAAAABA BAAABABBABBB BAAAABAAABBB BABBBBBABBAB AAAABBBBAABA BBAABABBBABB BAAAAABBBBBA ABABABABAABA BAAAABBAABBB BABBABAABABB BAAAB...
output:
3887
result:
ok 1 number(s): "3887"
Test #39:
score: 0
Accepted
time: 9ms
memory: 5624kb
input:
200000 13 19374912951 ABAABAABBBABA BABBABAABABBA AAABBABBBBAAB BBABBBBABBBBA BABBBBBBBABBA BABAAAABABABB BAABBBAABABAB AABBABBBBAAAA ABBABABAABBAB AABBAABBAABAA AABABAABABBBA ABAAAABABAAAA AABBAABBAABAB ABBBABAAAABBB BBBABABBAAAAB BAABBBAABAAAA AAAABBAABABAA BAABBAAABBBBB BBBABABBABBBA BBAABAAAAABA...
output:
6372
result:
ok 1 number(s): "6372"
Test #40:
score: 0
Accepted
time: 9ms
memory: 5672kb
input:
200000 14 19980372123 BABBBAABAAABAA BBBAABAAABABAB ABABABABABAABB BBAAABBBBBBBAA ABBABBABBABABA ABBBABBBAAAAAA AABABBABBBAAAB AABAAABABBBBBB AAAAABABBABBAA BBABBABABBBBAB BBBBABABAABAAB ABBABBBAABBBBB BBBAAABBABABBA BBABBBAAABABBA AAAABBAAABBABA BBAAAAABBABBAA AABBAAABAABBAA BAAABBBAABBABA AABAAAAA...
output:
665
result:
ok 1 number(s): "665"
Test #41:
score: 0
Accepted
time: 12ms
memory: 5820kb
input:
200000 15 19980372402 AAABABABBABAAAA BAAAABAABBBAABA AABBBBBABAAABBA AABBAABAAAAABBB BBBBABBABABBBBB ABBABABABBBAABA BBBBABAAABAABBB BBABBAABAABBBBA BAABABBBAABAABA BAABABBBBAABBAA ABABAABBABABBAA ABABABABBBABBAA ABAAAABBAAAAABB AAABAABAAAABBBB ABABAAABBBABBAB AABBAABBBAABBBA AAABABBBBBAABAA AAABAA...
output:
3150
result:
ok 1 number(s): "3150"
Test #42:
score: 0
Accepted
time: 19ms
memory: 6132kb
input:
200000 16 19921763623 BBAABBABABAAAABB BBABBAAAAABAABAA BBBBAABAAAAABBAB AABABBABAAAABABB AAABABAABABAABBA BBBBBBABBABBAAAA ABABABABAAAAAAAA ABAABBBBBAABBBBA ABAABBAAAABBBBAA BBBABBBAAABAAABA BABAABBBAAAABAAB BBBBBABBAAABBBBB BABBBBABABBAABBA BABABABAABBABAAB AABAABBBAAAAABAB ABBABAAAABBAABBA AABAAA...
output:
38403
result:
ok 1 number(s): "38403"
Test #43:
score: 0
Accepted
time: 21ms
memory: 10244kb
input:
200000 17 19921783725 BABBBBABBBBBBBBAB AABABAAABAAAABAAB BAAAABAABBBBABAAB AABBBAAABAAABBABA AAAAABBBAABBAABAA AAABABAAAABABBBAA AABAABAABBBBAAABA ABABAABABBBABBAAB AABBBBBABBAABABAA BABAAAAABBBBABBAA AAAAAAAABBBAAAAAB BBAABAAAABBABABAA AAABBBABAABBABBAB ABAAABBAAABABBABA BABBBBAAABBAABBAB AAAAABBA...
output:
73656
result:
ok 1 number(s): "73656"
Test #44:
score: 0
Accepted
time: 46ms
memory: 11476kb
input:
200000 18 19921779649 AAABAABBAABBBBAAAB ABBBAAAAABBBBAAAAA BBAABBBBBABBABABBA BABAAAABBAAABAABAA BAABBAABAABABBAABB AAAABAABABABBABBAA BBBBBAABBABBBAAAAA BAAAABABAABABBBBBA BABAAABBABABABBABA AABABAABBAABBAABAB BBABBAAABABBBBBABB BBBAAABABBAABBABAA BBAABBABABAABBBABA BBBBABBAABAABABBBB BBBABAABBBAB...
output:
174446
result:
ok 1 number(s): "174446"
Test #45:
score: 0
Accepted
time: 103ms
memory: 14976kb
input:
200000 19 19998678767 BBAABABBBAABBBBBABA AAABAAAABBABBAAABAB BABAAABBAABBABAAABA BABBABBBBAAABBBAABA ABAABABAAABBBAAAAAA BAABBBBBAAAAAABABBB ABABBAAAAABBABABBBB AAABBBBBBAAABBABAAA ABBBAAAAABAAAAABABB ABAAABAAAABAAABBAAB ABBABBAABBAABBBBBBB BBABBBBAAAAABAAABAB ABBBABABAAABBBBABBA BABBBBBAAAAABBBBAB...
output:
13094
result:
ok 1 number(s): "13094"
Test #46:
score: 0
Accepted
time: 71ms
memory: 12852kb
input:
200000 19 1 AAABBABABABBBAABAAB AAABBABABABBBAABAAB AAABBABABABBBAABAAB AAABBABABABBBAABAAB AAABBABABABBBAABAAB AAABBABABABBBAABAAB AAABBABABABBBAABAAB AAABBABABABBBAABAAB AAABBABABABBBAABAAB AAABBABABABBBAABAAB AAABBABABABBBAABAAB AAABBABABABBBAABAAB AAABBABABABBBAABAAB AAABBABABABBBAABAAB AAABBABA...
output:
0
result:
ok 1 number(s): "0"
Test #47:
score: 0
Accepted
time: 95ms
memory: 14892kb
input:
200000 19 15999918345 AAABBBBBBBAAABAABBB BBABBBABBBAAAAAAAAA BBABBBABBBAAAAAAAAA AAABBBBBBBAAABAABBB AAABBBBBBBAAABAABBB BBABBBABBBAAAAAAAAA BBABABBABBAAABBABAA BAAABAABBBBABBBAAAB BBABBBABBBAAAAAAAAA BBABABBABBAAABBABAA BBABABBABBAAABBABAA BBAAAABBBAABBBBAAAA BBABBBABBBAAAAAAAAA BBABBBABBBAAAAAAAA...
output:
498656
result:
ok 1 number(s): "498656"
Test #48:
score: 0
Accepted
time: 91ms
memory: 12024kb
input:
200000 19 17999910984 BBBABABBBBAABAAABBB ABBBBAABAAAAAAABABA ABBBABBBBBBBABBABAB ABBBBAABAAAAAAABABA ABBBABBBBBBBABBABAB ABABAABBABBAABABAAA BBBABABBBBAABAAABBB BBBAABBBAAAAAAABBBA ABBBABBBBBBBABBABAB BBBAABBBAAAAAAABBBA BBAABBBABBBBABABBAA BBBABABBBBAABAAABBB ABBBBAABAAAAAAABABA BBBABABBBBAABAAABB...
output:
437471
result:
ok 1 number(s): "437471"
Test #49:
score: 0
Accepted
time: 94ms
memory: 15048kb
input:
200000 19 19599890919 AABAAABAABAABBBBABB BAAABBBABBAAABBABAA ABBBBBBBABABAAAABAA ABBBABAAAABBBBBBBAA AAAABAAAABBBBBAABAA AABBABBAAAAABBBBBAA AAAAABBAABABBAAAAAB ABBBABAAAABBBBBBBAA BAAABBBABBAAABBABAA ABBAABBBBBBABBAABAB AAAAABBBAABBABAAAAA ABBBAABABBABABBAABB BABAAAAABABABAAAABB BBABBAAABAABBAABAA...
output:
130053
result:
ok 1 number(s): "130053"
Test #50:
score: 0
Accepted
time: 93ms
memory: 15260kb
input:
200000 19 19719579316 BBAAAABBABAABBAABAA ABAABBAABABBAABAAAB ABBABABBBBBBAABABBB BABBAAABBBBABAAAAAB ABBBBBBBBBAAAABBBBB BAAAABBBBBBBBBABABA ABAAABBBAABBAAAABAA BABBABAAAAAABABABBB ABABBABAABBBBBBABBB BBBAABABBBBAABAABAA ABABABBBABBAABABAAB AABABAAAABBBBBBABBA BABAABABBABBAAAAABA BABABBAABBBBAAABBA...
output:
397548
result:
ok 1 number(s): "397548"
Test #51:
score: 0
Accepted
time: 95ms
memory: 14984kb
input:
200000 19 18719925174 AABBABABBABBBABABAB ABAAABABABBBAAAAAAB AABAAABBABBBABABBAB BABABBAABAAAABBBBBB AAABBABBAABABAABBAB BBBAABBBABABABABBAB ABBAABAABABBBBAABAB BBABBABABBABBABBBAB BAABAABBAABABABAAAA ABAAAABABBBBBAABABA ABAAAABABAAAAABBBBB ABBBABBABAAABBBBABA BBBABABAAAAABAAAAAA AAABAAABAAABAAABAA...
output:
520845
result:
ok 1 number(s): "520845"
Test #52:
score: 0
Accepted
time: 99ms
memory: 15464kb
input:
200000 19 19959307756 BBAAABABBABABAABAAB BABBBABABBBBABABBBB BABBBBAAAABBAAABBBB BBBBAABAAAABAAABBBA BAABBBBABBABAAAABBB BBAAAABABABBBBAABBA ABABABAAABBBBABAAAB BABBAABABBBAAAABABB BBABBBBAABAABABBBAB BAAAABBABAAABABABAA BBAABBBAABBABBABBBB BAAAAABAABBABABABAB BBBABBBABAABBBBBABA BAAAAAABAAAABAAAAB...
output:
247886
result:
ok 1 number(s): "247886"
Test #53:
score: 0
Accepted
time: 94ms
memory: 14148kb
input:
200000 19 19991028941 ABAAAABBBABABBABAAB BBBBBBAAABABABABAAA BBABBBAABBABABABBAB AAAABBABBBBABABABBA BBBBBAAAABBAAABBBAB BAAABABAABABAAABABB AABAABABABAABBBABBA ABAABBBBABAABABBABB AABABBABABABBBAABAB BAABABAAAABABBABBAB ABBABABBABABBABABAB AABBAABBAABAAABBAAB AAAABBBAABABBABAABA BABAABAABBBBABAAAB...
output:
78389
result:
ok 1 number(s): "78389"
Test #54:
score: 0
Accepted
time: 100ms
memory: 14004kb
input:
200000 19 19958795374 BBBABABBBBBBBABBAAA ABBBABBBBBABBABAAAB AAAAABABBABABBAABBA AABAAABAABAAABABABB ABBABBAABABBABBAABA ABBBABBBBABBBAABABA AAABAAAABAAAABBBBAB BAABAAAABAABBBBBBAA ABAABBBBBBBABAABBAB BAAABABABABBBBABAAA ABAABBBBABBBBBBBABA BBAAABABAABBBABBABA BBAAAAAABBBBBAABABA AAABAAAABAAAABBBBA...
output:
334238
result:
ok 1 number(s): "334238"
Test #55:
score: 0
Accepted
time: 101ms
memory: 15084kb
input:
200000 19 19960448555 BBAAABBAABBBBBBBBBB BBBBAABAAABAABAABBB ABABBBBABABAABABABA BAABBBBAAABBBBBABAA BBAABAAABABBAAAAABA BBBBBABABABBABBBBAB BBAAAABBAAAABBBBBBB BBBABAABAAABABBBBAA AAABBABAAABABAABABA BABBBABAAABBBABBBAB AABBBABABABBAAAAAAB ABAABAAABBABABBAAAA ABBBABBBBBABAAAABBA BBBBBABBBBBBBABAAA...
output:
349440
result:
ok 1 number(s): "349440"
Test #56:
score: 0
Accepted
time: 100ms
memory: 15676kb
input:
200000 19 19980263140 ABAAAAABBBBAAABABAB BAAAABABAABABABBABA AABABBBABBBABBAABBA BABBABABABBBABABBAA BAABBABBBBBBBBAAAAB ABABAAAABAABABBABBB BAAAAAAAAABBAAABBAB BABBBBABBBAAAABBAAB BABAAABABABBBABABBA ABBAAABABBBAABABBBB AAAABABBBAABAABAABA AABBBABBAAABBABBABA BAABBAABABABABBBBBA ABAABABAAABABBBBBB...
output:
206671
result:
ok 1 number(s): "206671"
Test #57:
score: 0
Accepted
time: 103ms
memory: 13972kb
input:
200000 19 19687449585 ABABAABBAAAAAAABBBA AAABBABBBABBBBABBAB BBAABABABABBAABABAB ABABBAABABBABBABBBA BBBBAAABBBBBBABAABA BABBABABBAAAABBBAAA AAAABAAABAABBBABABA AABAABBBAAABAABABBB ABBBABBAAAAAABBAAAA BABBABABBABBBBABBAB BAABAAAAABBBAABBAAA BABABABBAAAAAAAABBB BBABAAABBBBABAAABBA BAAABABBAABBAABABB...
output:
485423
result:
ok 1 number(s): "485423"
Test #58:
score: 0
Accepted
time: 214ms
memory: 23084kb
input:
200000 20 19980375286 ABBBBAABBBABAABBBBBA ABABAAABBABBABBABBAB BBBAAAABABBABABAABAB BBBAAABABABBABAABAAB AABBAAAABBBBABAAAAAA ABABBAAABABABBBABBAA BABBBBAAABABAAAAABAB ABAABBBBBABBABABAAAB AAAABBAABBBBBBABBBBA BAABBBBBABBBBABAAAAB ABAAAAAABBABBBBBAABA BBBBBBAABBABABAABAAA AABBBAAABAAABBABABBB ABABB...
output:
444096
result:
ok 1 number(s): "444096"
Test #59:
score: 0
Accepted
time: 151ms
memory: 21100kb
input:
200000 20 1 BABBAABBAABABABBBAAB BABBAABBAABABABBBAAB BABBAABBAABABABBBAAB BABBAABBAABABABBBAAB BABBAABBAABABABBBAAB BABBAABBAABABABBBAAB BABBAABBAABABABBBAAB BABBAABBAABABABBBAAB BABBAABBAABABABBBAAB BABBAABBAABABABBBAAB BABBAABBAABABABBBAAB BABBAABBAABABABBBAAB BABBAABBAABABABBBAAB BABBAABBAABABAB...
output:
0
result:
ok 1 number(s): "0"
Test #60:
score: 0
Accepted
time: 181ms
memory: 21744kb
input:
200000 20 15999914477 BAABBBAABAABAAABBBAB ABBAAABBBBBABBAAAABB ABBAAABBBBBABBAAAABB BABBBBBBBBABAABABBAA ABABBBBABBABAABAABAB BAAABABBAAABBBBBAABA ABABBBBABBABAABAABAB BABBBBBBBBABAABABBAA BAABBBAABAABAAABBBAB BABBBBBBBBABAABABBAA ABABBBBABBABAABAABAB BABBBBBBBBABAABABBAA BAABBBAABAABAAABBBAB BABBB...
output:
1016656
result:
ok 1 number(s): "1016656"
Test #61:
score: 0
Accepted
time: 159ms
memory: 22008kb
input:
200000 20 17999925959 AABBBAABABAAABBAAABB BBAAAAABBBABBBBAABBB BABABBBBAAAABAABBBBB AABBABAABABAABBAABBA BABABBBBAAAABAABBBBB AAAAAAABBBAAAABAABBB AABBBAABABAAABBAAABB BBAAAAABBBABBBBAABBB BABABBBBAAAABAABBBBB AABBBAABABAAABBAAABB BBAAAAABBBABBBBAABBB AABBBAAAAAAABBBBAABB BABABBBBAAAABAABBBBB AABBB...
output:
848192
result:
ok 1 number(s): "848192"
Test #62:
score: 0
Accepted
time: 204ms
memory: 21892kb
input:
200000 20 19599929715 AAAABBBBAABABAAAABAA BAAAAAAABBABABAAABAB BBBABBAABAABBBBABABA BAAAAABABAAAAABBBABB BBAAAABAABBAABAABABB BBBABABAABAABAABBAAB BBBBBABBABBBAABBABAA AAAABBBBAABABAAAABAA AAAAABABABAAABAABABB AABBBABABAABBABBBAAA BAABAABABBBAABAABBBB BBAABABBAAABAAAAAABA BBAAAAAABBBAABABABBB BBBAB...
output:
419266
result:
ok 1 number(s): "419266"
Test #63:
score: 0
Accepted
time: 211ms
memory: 23148kb
input:
200000 20 19780102477 AAAABBABABAAAABBABBA AABBABABAAABBBABABAA ABBBABAABAABBBBBBBBB BAABAABBBBBBAAABABBB ABABABBAAAAABAABBABA ABBABBBABBBBBABABBAB BABBABAABBBAAABBAAAB AAABBAABBBABAABAABAA ABBBBAABBAABAABBABBA BBBABBAABBABAAABAABA BAAABBBBBBAAABABBBAB ABBBABAABAABBBBBBBBB BBAAAABABABBAAABAABB ABBBA...
output:
544749
result:
ok 1 number(s): "544749"
Test #64:
score: 0
Accepted
time: 216ms
memory: 23784kb
input:
200000 20 19885391989 BABABABAAABAAAAABAAB AABBBBBABAAABBABBAAA BBABAABBBBBBBBBABBAB AAABAABBAAABAAABABAA AABBABABBBABAABAAAAB AAABBBBABBAABBAAAABB BAABBBAAAABABABABBBB BBBBAABABABBAAAAABBB AAAAABABBBAAABAAAAAB AAABABAAAAABBAAABBAB BAAAAAABBAAAABABBABA BBBBBBABBABBBBAAABBA BABABBAABABBBBBAABAB AABAA...
output:
801683
result:
ok 1 number(s): "801683"
Test #65:
score: 0
Accepted
time: 214ms
memory: 21960kb
input:
200000 20 19941817038 ABABABBBAAAABBBBABAA BABBBBAABBBBAAAAAABB ABABABBAABBABBBBABAA AAAABABABBAABBBBAABA BABABBAABBBBBBABBBAB BBBBBABAABBBABABAABA BBBBBBABAABABBBBABBA AAABABABAABAABABBBBA BBBBBAAAAABBBAABBBAB ABBABABBBBAABABBBBBB BAAABBAAABAABBAAABAB BAAABBAAABAABBAAABAB AAAAABBBABBBABBBBABB BABAB...
output:
653509
result:
ok 1 number(s): "653509"
Test #66:
score: 0
Accepted
time: 213ms
memory: 22224kb
input:
200000 20 19976506600 BBBAABAAAAABBABBBBBB AABBBBBBABBBBBBAAABB BAAAAAAABBBBBAAAABBB BBAAABBBBABBBABBBBBB BBABBABBBBABBABAABBB AABBABAAABAAABABABBA BBBBAABBBAABABBABBAB AAABBBBBABAABBBBBBBB ABBBAAAAABBBAAAABBBB AABBBABAAAABABBBABAB AABABBBABABAABABBBAA ABBBABABAABBAAAAABBA BBABBBBABBBABABAAABB ABBBB...
output:
481280
result:
ok 1 number(s): "481280"
Test #67:
score: 0
Accepted
time: 202ms
memory: 23180kb
input:
200000 20 19992983839 AAABABBAABAAAAABBBAA ABABBBBAABABAABBBBBA ABAAAABAAAAABAABBABB AAABBBABBAAABAABBABA AABBABBABABBABAABABB BAABAABAABBBBAAAABBB ABAAABBBAAABABBBAABB ABABABBBBBAAABBBAABA AABBBBABAABAAABBAAAA BBBABAABABAABBBABBAB AABBABAAABABABAAAAAA BBABAAABABBBBAAAAABB AABBABBAABAAABBABBBA AABBB...
output:
242175
result:
ok 1 number(s): "242175"
Test #68:
score: 0
Accepted
time: 216ms
memory: 23588kb
input:
200000 20 19989794025 BBABBBBABAABBBBBBAAA AABABBABBABBABBBABAB ABAABABAAAABABBBABAB BBBBBBBAABAABBBAABAA ABBAAABABBABBAABBABA AAAABABAAABAAABBABAB AABBAABABBBBABAABBBA AAABBBABAAABAAABBBBB ABBABBAABBBBBBBABBAB BAABBABAAAAAAAAABABA BABBBBBBBAABBABBBBBB BBBBBABABABABBAABBBB BABAABBBABABAAABBAAB BAAAA...
output:
282959
result:
ok 1 number(s): "282959"
Test #69:
score: 0
Accepted
time: 221ms
memory: 23628kb
input:
200000 20 19994890116 AABBABBBAABABBABAABB BAABBBBBBAABABBBBBBB BBAABAABAABABABBBAAA AABABBBBBBAABABBBAAB BABAAAABAAAABBBBAAAA BBAAAAABAAAABABABBAB ABAAAAABABABBBBBAAAA ABABABBBBAAABBAABAAA ABABABBBBBBBBBBBBAAA ABBABBBBABBAAABAABBB BBBBBBBBBBBBAAAAAAAB ABABABBABBBBABAAAAAB BABBBAABBAABABAABBBA ABAAA...
output:
169460
result:
ok 1 number(s): "169460"
Test #70:
score: 0
Accepted
time: 215ms
memory: 23720kb
input:
200000 20 19960849809 AABAABABBAAABBABABBB BAAABBAABBBAABBABBAA BAAABBBABBAABABBABAA BBBAABABBABBBABABBBA ABAABBABABBAAABBABAA BBBBBBBBABAABBBAABAA ABBBBBABBBBBBAAABAAA AABBBAABABABBABBBBBA BABABBABBABBAABBAABB BBBBABBBAABAABAAAAAB BAAABABBBBBABBAABBBB ABBABAAAABBABAAABABA AAABBABBBBABBBBAABAA ABABA...
output:
772436
result:
ok 1 number(s): "772436"