QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#329988 | #6611. United in Stormwind | Ogiso_Setsuna | AC ✓ | 118ms | 20060kb | C++14 | 1.2kb | 2024-02-17 10:19:49 | 2024-02-17 10:19:49 |
Judging History
answer
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
using namespace std;
typedef long long ll;
const int N=(1<<20)+5;
double Cor[2][2]={{1,0},{1,1}},Cand[2][2]={{1,1},{0,1}},Cxor[2][2]={{1,1},{1,-1}},
ICor[2][2]={{1,0},{-1,1}},ICand[2][2]={{1,-1},{0,1}},ICxor[2][2]={{0.5,0.5},{0.5,-0.5}};
int n,m;
ll _n,K;
double f[N],g[N];
void FWT(double *f,double c[2][2]){
for(int i=1;i<n;i<<=1)
for(int j=0;j<n;j+=i<<1)
for(int k=j;k<i+j;k++){
long long x=f[k],y=f[k+i];
f[k]=c[0][0]*x+c[0][1]*y;
f[k+i]=c[1][0]*x+c[1][1]*y;
}
}
int main(){
cin>>n>>m>>K;
rep(i,1,n){
char s[25];
cin>>s+1;
int w = 0;
rep(i,1,m) w=(w<<1)|(s[i]=='B');
f[w] += 1;
}
_n = n;
n = 1<<m;
FWT(f,Cxor);
rep(i,0,n-1) f[i] = f[i]*f[i];
FWT(f,ICxor);
//rep(i,0,n-1) cout<<f[i]<<" ";
rep(i,0,n-2) g[i] = f[(n-1)^i]/2;
g[n-1] = (f[0] - _n)/2;
//puts("");
//rep(i,0,n-1) cout<<g[i]<<" ";
//puts("");
FWT(g,Cand);
//rep(i,0,n-1) cout<<g[i]<<" ";
ll sum = 0;
rep(i,1,n-1) if(_n*(_n-1)/2-g[i]>=K) sum++;
cout<<sum;
return 0;
}
/*
5 4 1
ABAB
BBBB
AAAA
BABA
ABAB
*/
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3492kb
input:
2 2 1 AA BB
output:
3
result:
ok 1 number(s): "3"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
2 2 1 AA AB
output:
2
result:
ok 1 number(s): "2"
Test #3:
score: 0
Accepted
time: 1ms
memory: 3552kb
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: 3656kb
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: 3512kb
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: 3636kb
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: 1ms
memory: 3508kb
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: 1ms
memory: 3488kb
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: 1ms
memory: 3556kb
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: 1ms
memory: 3632kb
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: 68ms
memory: 20004kb
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: 62ms
memory: 19864kb
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: 63ms
memory: 19872kb
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: 59ms
memory: 19984kb
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: 58ms
memory: 19916kb
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: 59ms
memory: 20052kb
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: 58ms
memory: 19992kb
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: 60ms
memory: 19984kb
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: 65ms
memory: 19992kb
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: 10ms
memory: 3536kb
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: 15ms
memory: 3488kb
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: 17ms
memory: 3684kb
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: 19ms
memory: 3540kb
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: 21ms
memory: 3692kb
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: 23ms
memory: 3536kb
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: 22ms
memory: 3672kb
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: 27ms
memory: 3676kb
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: 29ms
memory: 3608kb
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: 33ms
memory: 3628kb
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: 30ms
memory: 3608kb
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: 38ms
memory: 3624kb
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: 34ms
memory: 3692kb
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: 33ms
memory: 3604kb
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: 36ms
memory: 3636kb
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: 34ms
memory: 3548kb
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: 33ms
memory: 3704kb
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: 36ms
memory: 3720kb
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: 37ms
memory: 3548kb
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: 41ms
memory: 3748kb
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: 42ms
memory: 3784kb
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: 46ms
memory: 4044kb
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: 41ms
memory: 4628kb
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: 51ms
memory: 5644kb
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: 65ms
memory: 9204kb
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: 81ms
memory: 11744kb
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: 77ms
memory: 12048kb
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: 82ms
memory: 12408kb
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: 73ms
memory: 13164kb
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: 74ms
memory: 12820kb
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: 73ms
memory: 13332kb
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: 78ms
memory: 12656kb
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: 75ms
memory: 13596kb
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: 77ms
memory: 12532kb
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: 84ms
memory: 13688kb
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: 78ms
memory: 13572kb
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: 80ms
memory: 13520kb
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: 79ms
memory: 12836kb
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: 118ms
memory: 20048kb
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: 113ms
memory: 19916kb
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: 116ms
memory: 19984kb
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: 109ms
memory: 19976kb
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: 115ms
memory: 19992kb
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: 118ms
memory: 20060kb
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: 107ms
memory: 19964kb
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: 110ms
memory: 19936kb
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: 102ms
memory: 19908kb
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: 109ms
memory: 19912kb
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: 118ms
memory: 19992kb
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: 115ms
memory: 19968kb
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: 109ms
memory: 20052kb
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"