QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#89615 | #5254. Differences | zsj6315 | AC ✓ | 672ms | 87880kb | C++14 | 702b | 2023-03-20 19:34:01 | 2023-03-20 19:34:04 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define fr(i,a,b) for(int i=a;i<=b;i++)
#define ull unsigned long long
#define mod 998244353
#define N 100005
#define pb push_back
int n,m,K;
ull w[N],a[N],pw[4];
vector<int> s[N];
mt19937_64 zsj(19260817);
int main(){
scanf("%d%d%d",&n,&m,&K);
fr(i,1,n)w[i]=zsj();
fr(i,1,n){
s[i].pb(0);
fr(j,1,m){
char c=getchar();
while(c<'A'||c>'D')c=getchar();
s[i].pb(c-'A');
}
}
fr(j,1,m){
fr(k,0,3)pw[k]=0;
fr(i,1,n)pw[s[i][j]]+=w[i];
ull sum=0;
fr(k,0,3)sum+=pw[k];
fr(i,1,n)a[i]+=sum-pw[s[i][j]];
}
ull sum=0;
fr(i,1,n)sum+=w[i];
fr(i,1,n)if(a[i]==(sum-w[i])*(ull)K)printf("%d\n",i);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 529ms
memory: 77468kb
input:
3585 4096 2048 ABBBBBBAABAAAAAAAAAAAAABAABABBBABABAAAAABABAAAABAABAABBABBAABAABABBABAABBABBABABABBAAAABBABAABBBBABBBAABBBBBABAABAAABAAABBBBAAAABAABAABABABABBBBBABAAABAAABBAABABBABAABBAABBAABABBBBAABAAAABAABBABAAABBAAAAAABAABBABBABAABABBBAABABBABABBBAAAAABBBABABABBAABAAAABBBBABABAABBBABABABBAABBBABAB...
output:
1397
result:
ok single line: '1397'
Test #2:
score: 0
Accepted
time: 649ms
memory: 87880kb
input:
4099 4100 2 ABABBAAABBBABBBAABAAAAABABBBBBAAAAABBABBBBABBAAABBAABAAAAAAAAABBABAABAABBAAABAAAABBAABBBBABAAABAABABBAAABBBBBABABBBBBABBABBAABBBABAAABBABBBBAAAABAABBAABAABABABAAABAAAAABAABABBBAAAABBBBBBBABBBAABABBABABBBABAAAAABBBBABAAABABBBAABBAABBBABBABBBABBAABABBABBBBABBBABAABBBAAABAABAABBABAAABABABAB...
output:
2964
result:
ok single line: '2964'
Test #3:
score: 0
Accepted
time: 623ms
memory: 85940kb
input:
4002 4096 2048 ABBBAAABAABBBABBBBABBBBBBBAABBABBBAABABBABBABBABBAABABBBBBAAAAABBBBBBAAAAAABAAAABBBABABAABBBABABAAAABBAABAABABBBABBBBABAAAABBBBBBABBBAAABABBABABAABBABAAABABBABABABAAAAAABABAABABAABBAAAABAAAAABBABAABBAAAAAAABBAAAAABABBABABAAAAABBABBBBBABABAABABBBAABBAAABBBBAAAAABBBBBBBABBBAABBAABBAABBB...
output:
3926
result:
ok single line: '3926'
Test #4:
score: 0
Accepted
time: 544ms
memory: 83672kb
input:
3892 4096 3072 CCBACBACABCBBCDBDBBDDABDADCDCCAABAAADADDCBABABACAACCADDDAAACBCDACCBDBCCCACACBBBCADBBDBABDACAABADBBBADADADBAADBCCDBDAADCCBDCBDBAACAABDABDAADBBCDDCADDBBDBDBDDBBDACCCCACBACCBADDCCDCDCCACBCDDCDCCCADCDDAADBBDABAADBDDDACBDBDDDBACDAABBBDDABACAACDAADBBBCDCCCAAAADDCBDBBCBDDADCAACCAABBCCBDBABCB...
output:
2870
result:
ok single line: '2870'
Test #5:
score: 0
Accepted
time: 640ms
memory: 87848kb
input:
4099 4100 2 CCCDDBDBBCADADBBACDCDDBACCDABADCDDDDBCDDABABDBCCCBCCCDDDCBAABADABDBCABDBDDDCBBCABCCBBDCDBCDCBCCCBABCCBABCDBBAABADCAACBBDDABBBDDBCBDDCCDCADDDBCBBDABCBDBCCCACCADBBDDDCBDCDACCCBCBBDADAAACDADCDDCAACADDCDBDDBBBBCDAADDAADDDDADDCCDCBDDBAACABDADCACAABCCAAACACBCDCBBAABCAACCCDABBDBCDABBDBCCCADBCAA...
output:
2128
result:
ok single line: '2128'
Test #6:
score: 0
Accepted
time: 621ms
memory: 86784kb
input:
4043 4096 3072 CADABDBABCBCDDDCABAAADCDBDDBBDCCBAAADCDCCBDAACABDBCAABCDADCCCACDBBABABCCDCCACDDABDADBACCBBCBDBABDCBBADADCBDDDDDDCBABBDCAABBCDBADBDCDBDBCBDDCABBDBCDCADABDDBCACABDCCBCADBBDCDCDCAAADBADADCCDDDADDAABDDDCDBCCBCAABDBCBACACCADDCBBCBCDACCCCCAAAAAAADDABBBBABADCAAADCAAADACCBBACBCABDDDDBCABDABAC...
output:
3952
result:
ok single line: '3952'
Test #7:
score: 0
Accepted
time: 309ms
memory: 49672kb
input:
2188 4100 1458 ABACDBABBDDDACBCBCBADACCCCBADBCBDBBCDBDADDBDBDACADABBBCBBAAADCDACADDCCDBADBDBDBBDCBBDDBBCDABDBCCCBDBADAABCADCCDDAACCADABABCADCCDCABCADBCCABADBCADAAAABDAACBAAADBCBBBBDDBCCCBCADDBDDBCADDAACACDDBDBCDCDBCDDBBCADDADDADCDDCDCDCAAADAAACDDABBCDCBDACCDACACCCACABDDCCCDCABACAAACCDABBDBCBDBCCBCAA...
output:
2090
result:
ok single line: '2090'
Test #8:
score: 0
Accepted
time: 3ms
memory: 5904kb
input:
85 96 48 AABAAABBABABBAABBBABABBABBBAAAABBABBBAABBBAABBAAABBBABABAAAABBAAABABABBBABAAAABBAABAAABBAAAABAAB AAAABABAAABBBAAAAAABBBBAABBABBBBABAAABABAABAABAABBABABBBABBBABBBABBBBABAABBABABAABBBABAABBAAAABB AAABBAAAABBBAABBBAAABAAAAABAABABAABABABBABBAABBBAABABABBBBBABAAABBBABABBBBAAAAABAABBAAAABABBABAB ...
output:
10
result:
ok single line: '10'
Test #9:
score: 0
Accepted
time: 3ms
memory: 5988kb
input:
99 100 2 DBCBDACCACBBBBCACCDABADCAADDBACBBADABACCCBDADCABBABDAACDBCBDBBDCCBACDDDBBACBABDCDDBCCCBBBBCBADABABDA DBCBDACCACBBBBCACCDABADCAADDBACBBADABACCCBDADCABBABDAACDBCCDBBDCCBACDDABBACBABDCDDBCCCBBBBCBADABABDA DBCBDACCACBBBBCACCDABADCAADDBACBBADABACCCBDADCABBABDAACDBCBDBBACCBACDDABBACBABDCDDBCCCBBB...
output:
2
result:
ok single line: '2'
Test #10:
score: 0
Accepted
time: 2ms
memory: 5844kb
input:
10 3 1 BAA ABA BAA ABA ABA AAA BAA BAA BAA AAB
output:
6
result:
ok single line: '6'
Test #11:
score: 0
Accepted
time: 4ms
memory: 6088kb
input:
73 81 54 CABCABCBBABABCBCAABCAACCCBBCBAACBBCABABAABCCCBBAABBBACCABABACBBCCBACBCBCCACCBCCBC AACBABBBBBCCBCCABCBBABBABCABAABCACBBAAABCCCBACBCABACCAABBBACCACACCACBBBCAABBBBABB AAABCBAACABAACABCCABCACCCBACBACACBACCACBBCCAABACBCAACAAACBBBBABACAABAACCABCBCCBCC CABCCAACCBACACBCCBBCABAABBCBBBCBABBBBCBCBBABB...
output:
69
result:
ok single line: '69'
Test #12:
score: 0
Accepted
time: 512ms
memory: 60952kb
input:
3457 4000 1728 CCAACADCBBBBCBDABADACDDCDACBDBBDDDDACCADAABCDADABDAAAADBCDABCDBBCADBDCBCACCDCDCBBABCAAACCCBBCAAADBCBADBBADAACCBDAACAACBBBBBDDCCACCDCBDADCBDBABBBACDDACCDDBCCDCACBCCDDCDBBCCBCCADCACACDCCCDBBBCBABCBACDBDAABCDCDBDBAADBDCCBBCDAABABBDDCCACCCAACDCBBBBADCDACCCDBBAAADBDBBBBADBCABDBCDCAAACBBBBA...
output:
2626
result:
ok single line: '2626'
Test #13:
score: 0
Accepted
time: 645ms
memory: 87776kb
input:
4097 4096 2048 CBABCCBCBCCBACCAABABACCCBACBCBABACAABAABBCAABCABCCCBCABCAABABCCCCACCCCAACAACBABBBABCAABBAACBCABBBBBBBBCACBCACABBABBBCCCBBBBBACABCCCBCCABCCCABBACBCAABCCABAACCBBAAABCBACBCCBCCCCCCBABABBBCBACCCBCABBAABBBAAABBCCCAACBBCCBCBBABACAABCBABBCBABCCCACBCCACBBBBCAAABAABBBBABACCCABBAABCAABABAABBCCA...
output:
3851
result:
ok single line: '3851'
Test #14:
score: 0
Accepted
time: 614ms
memory: 86576kb
input:
4041 4096 3072 CBAADCADBDCDAAACBDCCCBAAADBBCDDCBBABCBCDBAACDAAABDCCBADBDBBDCCBADACADABBBCCADCDDDDAADBCCCDAAAAADABCCBCDABCDCCDADBDCBCCCABCDCBDCDDDADDDCBACADBCAADDADBBBCAACDDCBCCDDBBBDBCCDABADBDBADCCCBABCDDCCCABDDDDBDDBBCBBBCCCDDDBCADCBDDBABBABCDDAACDBAABAADAACCBDBDCBADABCDDCADADBDACDDDAAACABDBBACDABB...
output:
2649
result:
ok single line: '2649'
Test #15:
score: 0
Accepted
time: 568ms
memory: 69740kb
input:
4000 4000 1 DBACDACCAADCABCCBAAACADACCDCBDCBADAAACCACBDDDBBACCAACABADADBDCCDCCDCBCDAADDDBBDDDAABBBCACCBBAABDCBBDABDAADDBADADAABBCACACDCDDACCBDCBACCBBCCBBCBCDDABDCCBCABCADBCDDAABCBDADACCCBBBBDBACDCDABADCCDBDDDCBCDADCDBDBDBABBDAACBBCADBABBDADADCBCAAAABABCBCBBDACACDAADBBDCBABDCDACAAAACDBBADABCBABBABDCB...
output:
175
result:
ok single line: '175'
Test #16:
score: 0
Accepted
time: 552ms
memory: 69936kb
input:
4000 4000 10 AAABABBABBBABBABBBBABBAABAABBAABBABBBAABABABBAAABABBBAAAAAAABABABBBBAABABBBBAAABABBABBBABAABAABABBAABAABAAAAAAABABBBABAABABABBBBBBBBBAABABAABAABBABBBBAAABAABBAABBBBBAABBBAABAAAAAAAAAABABBBBBAABABAAAABBBABAABBBABBBBABBBBABAAAAABAAABABBBAABBBBABBABBBBABABABBAABBABAABBBABABBBBABABBBABABBBB...
output:
3594
result:
ok single line: '3594'
Test #17:
score: 0
Accepted
time: 490ms
memory: 69884kb
input:
4000 4000 1000 CBBBBDADDBBACBACCACDAACCCBBCDABADDDCAAACDDADDABBACCCCDADCACDBDCADDACBAABCCABBCDCBCADDBDCABCBCABBDBDBAABBBDCCCCACCADBCDCDBBADACABADDCDDDCCBDCBAABBCADDBCABCDBBDDBDCDAACACAADABCBCDDADCDDCCDABDDADCACCDBBCAAAAAACDDDBDCBABBAADDDDCDCDABBABBBCBDBADBBCDDCAADCBCBADCCBAADABAABCDCCBCDCBDACACABCBB...
output:
440
result:
ok single line: '440'
Test #18:
score: 0
Accepted
time: 127ms
memory: 45000kb
input:
100 100000 10 ABBABBBBAAABBAAAAAABAAAAABBABAAABBBABAAABABABABBABABBABABAABABAABBBABBABBBBABABAAABAABAABBAAAAABABAABABAABBAABBABBAAABAAABBBAAAAABABAABAABBAABBBABBBBAAAABBABAAABBBBABAAAAAABBAABAABBABBAAAABAAAABABABBBBAABABBAABBBAABABBBAABBBBAAABBBAAAAABBABBBABAAAAABBAAABAAAABBBABBAABAAABABBBBABBBAAAAB...
output:
65
result:
ok single line: '65'
Test #19:
score: 0
Accepted
time: 137ms
memory: 44880kb
input:
100 100000 10 CABDDDBBBCBBDACDBCADDDCACBBBBBDDBBDAAACCDDDDACDBADBDDDABBBDDCDCDABAACDCCDCBDBABBADBDDBBBCAABDDBDACADBDBABCACDCAACBDBDBCCBCDBBABCCBCAADBCCBBCABCCDBACDCABBDCDADCDBADCDAACCCADDCCDACBDBCADCDDCDBCACBDCCAAACBACDCBABDACBACDABCDDAABCDDAAABCBBBBACBBCBADCDDDABCACDBADBBDCCCAADBBCDCABDAACADDCCDABB...
output:
44
result:
ok single line: '44'
Test #20:
score: 0
Accepted
time: 135ms
memory: 45004kb
input:
100 100000 100 BBABBAAABAABBBBAABAABAAAABAABBABAAABBAABBABAABBBBAABABBBABBABABBBBBBABBBAAABBAAAABBAABABBABAAAAAAABABABAABBABABABBBAABBABBBBBBBAABAABBAABABBBABABABABBBBAABAABAAAAAAABAAABBBABAAABBAAABBAABBBABBAABBAAAAAABBBBBBBABBABABBAAAABABAABABBBBBAABAAABAABBABABAAAAAABBBAAAABABBBAABBBAAABAAAAABABAB...
output:
86
result:
ok single line: '86'
Test #21:
score: 0
Accepted
time: 128ms
memory: 44780kb
input:
100 100000 100 CDDABDACADCADADABADDADADDDDCBAAAAABBABABBCBADBABCAADDBCCABBCCCCCCAADBAACDCDCAAACAABACADDBABACACBACBCCBBCAABABBCCCACAABDCCBCBBADCDABCCCACDBCACBCACBBDDABBBACDBBCABDCABDCBABCDDAABCBABCCCDCBDDCCAABCADCCBCADCDACBCABDCACCCDCCCACCBBDBDBCCCBABBDCADAACACADCCBACDCAACBAAACCBDDDCCDCDDAACADADBABAD...
output:
7
result:
ok single line: '7'
Test #22:
score: 0
Accepted
time: 156ms
memory: 44852kb
input:
100 100000 1000 AAAABAABBBABAAAAABBBAABABABABAAAAAAABBBABAABBAABABBAAAAABBAABAAABBAABABAABAAABAAABBBABBBAAAAABABBAAAABABABAAAABBAAAAAAAAAAABABABBBBAAAABABAABABABAABABBBBAABBBBBABABBBABABAABAAAABABABAAAAAABBABAAAAABABBABBAAABAAAAAABAABBBBBBAABAABBBBBBAAAABAAAABAABAABABABAABABBABAABAABAABBAAABAAAABAAA...
output:
20
result:
ok single line: '20'
Test #23:
score: 0
Accepted
time: 123ms
memory: 44712kb
input:
100 100000 1000 CDAAAAABCACBBAADADADDDCDDABAADDDCADDBAAABCBDDCCACCABBDBBDCCACCDBCDADDBDBAAAADCABBBCDAABACDBABBBDACDADCBDDBDCAADBBCBCCCCBBDCCADCBCBCBADBDBBBCBCDDABBDDDAADCDACCCAAACAAADBBBADDACDBDCADDBCCADBDBCDBADCBCACAACDABCBABBABCCDDCACDCBBDADADDDDDBDACBBDDCDABCDBAADACBBBCBCCBBCBCBBBDCACBDDDCCACCACB...
output:
68
result:
ok single line: '68'
Test #24:
score: 0
Accepted
time: 3ms
memory: 5972kb
input:
100 100 1 BBBBBAAAAABABAABABAABABBAABABAABAABBABBBABBBABBABBBAABAABBBBABAABBBABBBBBBBBBAAAABBBABBABABBAABBABAA BBBBBAAAAABABAABABAABABBAABABAABAABBABBBABBBABBABBBAABAABBBBABAABBBABBBBBBBBBAAAABBBABBABAABAABAABAA BBBBBAAAAABABAABABAABABBAABABAABAABBABBBABBBABBABBBAABAABBBBABAABBBABBBBBBBBBAAAABBBABBA...
output:
68
result:
ok single line: '68'
Test #25:
score: 0
Accepted
time: 0ms
memory: 6132kb
input:
100 100 2 CCBAACBBACAAABCBAABACBBBABBCAABACBBCBCACCACACACABBABBBABACAACABCBABBABABABCACCBCCCBACBBAACBBBACACACC CCBAACBBACAAABCBAABACBBBABBCAABACBBABCACCACACACABBABBBABAAAACABCBABAABABABCACCBCCCBACBBAACBBBACACACA CABAACBBACAAABCBAABAABBBABBCAABACBBABCACCACACACABBABBBABACAACABCBABBABABABCACCBCCCBACBBA...
output:
47
result:
ok single line: '47'
Test #26:
score: 0
Accepted
time: 4ms
memory: 6132kb
input:
100 100 60 ABBBAAACABCACBDADBBAABAAACDDDDBBCCBCBAADDCCBCBBCDBDDBBBDBABBCBDACCCACBAABCCDBBDCCACBDBCBBCBCADDACBAA CDCABBBABCBADBCCDABCCAADBAAADACCBCDDBDCBDCBCBAADCABCDCBCCDCBBBDBABDBABBDBDCADDACABADBBACCCDCCADDABDC DDABAADCBABCBDBCDABDCCCDDAABDCAACBBCDBBACDDCBABDCBABDBBBCAAACCDABBDCCBCACACDABDACBCDDBB...
output:
86
result:
ok single line: '86'
Test #27:
score: 0
Accepted
time: 4ms
memory: 5908kb
input:
100 10 5 CCCCCACABA AACCCBBBAC ACBAACBBCB CCBCCACCBB CBBCCCABAB ACACACBBCC CCCCABCACB ACBCBAAABC AACCBCCBCC AABBBAABBB CCCCABCCCB ACABBCCBCB ACACCCCACC ACCBBCBACB BAACAAAACB ACACBAACAA ACACCACABC BCCABACBCC BCBBCCABCA ABCBCACBBC AABCBAACBB ABCCBAAABC BCACBCAACB ABCCBABCBB ACAAAACCCB BBCCCABAAB ACBCC...
output:
68
result:
ok single line: '68'
Test #28:
score: 0
Accepted
time: 0ms
memory: 6080kb
input:
10 100 4 AABBBBBAAAAAAAABABBABAABBAABBBAAAABBABABBABBBABBABABAABBBABAAAAAAAAAAABBBBBBBABABBBAABBBBBBBAABBBBAB AABBABBAAAAAAAABABBABAABAAABBAAAAABBABABBABBAABAAAABAABBBABAABAAAAABAABBBBBBBABABBBAABBBBBBBAABBBBAB AABBBBAAAAAAAAABABBABAABAAABBBAAAABBABAABABABABAAAAAAABBBABAABAAAAAAAABBBBBBBABABBBAABBBB...
output:
10
result:
ok single line: '10'
Test #29:
score: 0
Accepted
time: 367ms
memory: 61136kb
input:
3456 3456 1728 DBBADABACACBACADAACBABDDABADDDDBAAACDDCAACBBCCDCDDDACDADCBBBBBBABDCDCCABCCDAABDBBDADAACCCBCCCBDCACDADABBCDBBBBAADDADADBCABCCABCAACBADDBABDABCCABDCADBADDBACDCADBDBBACCCBBABBBDDDADDDBCCDBADCABDBCBCDDBDACCCDCBDDADCCBBCBBAADBBCBAADABBABBCCCACCBBCDADDDADCDBABBBACACBBDABCBBCCCDACBAABACCADAA...
output:
1330
result:
ok single line: '1330'
Test #30:
score: 0
Accepted
time: 581ms
memory: 87728kb
input:
4096 4096 2048 BABBBAABABABAABAAABAAAABBAABBABBBABBABABABAAAABBBBABBABABAAABABAABBBBBABBAAABAAABBAAABBABABBABAAABAAAAABBAABBBAABBBBBBABBAABABAABBAAAABBBAABABAABABBABABBBAAABAAABAAABABAAAABBAABABABABABAAABBBAAAAAABBBBABBBBAAABABABBAABBAABAABBABABAAABBAAABBBBABBBAAABAABABBBBBABBAABABABABABBAABBAAAAABA...
output:
2121
result:
ok single line: '2121'
Test #31:
score: 0
Accepted
time: 664ms
memory: 87708kb
input:
4096 4096 3072 CDDDABADADDDBBCCDADBDAABCADCDAADDADDBDCDACCDDDAADCAAACACBDDACABCCCCCAACBCDCBDDCBDBBDCDCCBCABCBDBCCABBAACAADBADBBADDCCBDBADBBCCBCBDAACAABBCDBAADCADBCABADCABDBAACDDBDBDCABACDDDBBBDBBAAABAAADABDAAABABBAACBAABADBDBBADDABDADABBDDAACCBCDCDDBBDBDADBADBBACCCDBBCBCDCACADAABBAACCCABCDDDAACDBAAC...
output:
2705
result:
ok single line: '2705'
Test #32:
score: 0
Accepted
time: 672ms
memory: 87680kb
input:
4096 4096 3072 ADCABDBCBDDADDDBBDCCDAABBCBDCDBCCBABBACBADACCDABCCDBDCDCBBBDBCBDDAADCCCACBCDBBABADCAADBBBDADCCADCDDADAABADDCDBCCBBADBBACABDDACACDBDAAAADBACCADBCCBCBACAABCAAABBDCCBBCCCABDBBDDABAACCACCBCADDACAAAACCABDADAABACDADDDBCBBADDDABCDDADDCBBCDBBBCDAACBADADBDABABBDCAACADBCCCABDCDCDABCDBDCAADDBDAA...
output:
2670
result:
ok single line: '2670'
Test #33:
score: 0
Accepted
time: 545ms
memory: 82960kb
input:
3863 4096 3072 DADABACDDDDBACDABBBDDDAADCAABBBBACDAADACAABDDABACDDDDDABDCBBBCCDADDABBCCDCACACACAADBDCBCBDCACCACCCAACABDBCBACAABAADABDDACCABABDACBBADDDADAAAACDACAABDDCDBBCBDCDBAADBCBCBABDADCABABDBADBCDBADCDDDACACBCABDBDBBAADCDDDBCDBBCCBBBDABBCACCABCCCBABAAADDDDBCDDCDCBACCCDDBBCBADBACBBDBBADDCABBCBBAB...
output:
3572
result:
ok single line: '3572'
Test #34:
score: 0
Accepted
time: 549ms
memory: 77420kb
input:
3585 4096 2048 AABBABAAABAABAAABBBBAAABAABBABBBABAAABBBBAABBBAAAAAAAABABABBBBAABBAABAAABBBABBBABAAAABABABBABBBBBAABAAABAAAAABABABABABBABBABBAAAABBABBBAAABBABBBABABBBABAABAABBABBBBBBAAABBBAABABBABBBAABBBABABBABBBBBBAABAAABBAABAABABBAABBBBBABAABBBBABBABAABBABBBBBBBBBBBBBBBABABABBABBABBBBAABAABBBBBAAAA...
output:
444
result:
ok single line: '444'
Test #35:
score: 0
Accepted
time: 465ms
memory: 67268kb
input:
3073 4096 2048 BAABBABABBBBBABABBBBAABAABAAAAAAABBBBAABAABBAABAAAABBAABAABBBBABBBBBBAABAAAABBABBBBAAAABAABAAABAAAAABABBBBABAAAABBBBAAABBABBBBBAAAABAAAABBABAAABBBBBABABABBBBAAAAABBBAABAAAABBABAABABBBBABBABAABBAAAAABBAABBABABAAAAABABBBBBBABAABAABBBBAAAAAAABABBBAAAAABAAAABAABABBBBBBBBBBBABBBBBBBABBBAAB...
output:
2584
result:
ok single line: '2584'
Test #36:
score: 0
Accepted
time: 509ms
memory: 76064kb
input:
3515 4096 3072 CDDBBBDABCDABBADBBBCADDDABDBBAAADCBBDDAACCBCBDCABBBBDCBADACDAACBCCCDBDDAADBAAADABDCABBABADDCBBBBCACBDDCBCABCCBDDCCDBBCAAADBCBDDDCCDCADCCABADABCCCCBDBBABBBBDADCAABABCDBADCAACBABDDCBACABDCDDCABCDCCDBBBBABDBACAACBBABBCCDCBDBADBACCBDBAABCADDCADAACACAABBACACCAAABADAAADDADCCCCCCAACCDAAACAAB...
output:
829
result:
ok single line: '829'
Test #37:
score: 0
Accepted
time: 345ms
memory: 59012kb
input:
100000 100 10 BABBABBAAAAAAABBABAAAAABAABBBBBAABBAABBBAAABABABABBABAABAABABAABABABBBBAABBAAABABBBAABBBBABABBABAAAB BABBABBAAAAABABBABAAAAABAABBBBBAAABAABBBABABBBABABBABAABBABABBABAAABBBBABABAAABABBBBBBBBBABAABBAAAAB BABBABBAAAAABABBBBABABABABBBBBBAABBAABABAABBAAABABBABAABBBBABBABAABBBBBABBAAAABABBBB...
output:
1078
result:
ok single line: '1078'
Test #38:
score: 0
Accepted
time: 348ms
memory: 58972kb
input:
100000 100 10 CAAACDCDCADACDDCACBCCBABADDDDDABBBCBABACBAAADDCABADAACBCBBCBBCDACCCADDDADDACADDBACBCBDBCADACBDCBBBBA ACAACDCDCADBCDDCACBCCBDBADDDDAABDBCBABACAAAADDCABADACCBDBACBBBBADCCADCDADDACDDDBACBCBCDCADADBDCBDBBC CCAACDCDCADBCDDCACDCCBDBADADDAABDACBABACBDAADDCABADADCBCBACABBDBDCCCBCDADDACDDDBACBC...
output:
59854
result:
ok single line: '59854'
Test #39:
score: 0
Accepted
time: 598ms
memory: 86536kb
input:
4038 4096 3072 DABCCADCCABCCBCDACDBDBBDCADBCCDBAAAAACADCBBCAAABCABABDCCDCBADBBBABACCAABBCCCDBDCADADDBBCCDDCACCADADBCACBCDBCABCDBDBABDBCDCDDDABBBBCDACBACCDBBDDAABADDBBDDCDADDCBAAABCDCDCDBCBACCCDACACBACACBCCADDDABAADABBDBBDBBCCBCBBAACCCCDADABBBACADACCCADDDDCDBDDCCCBCACAACACCDBAABACADBADCBACBCBDDDBBABD...
output:
1675
result:
ok single line: '1675'
Test #40:
score: 0
Accepted
time: 624ms
memory: 86384kb
input:
4022 4096 3072 CDCADABBADDACACAACAADDCCCDBCCABCAABDBDBDCBADBACBBDBCCBCDBACDACABCDCBCBADDDBCCCCADDCBBCACCACADBABCDBDDCCBADACCBDCCCBDADBCCDBDBCDCAABCCBBBDABDCBDBADCCBDCDDBABCDDDACBCDCBDBCCDBCDBBDBBBBDAAABDBDDBADCABCDDAAAAACDABDBCADCDBDADCCDCBCCCDBBCBBADACCBDACCBACDCDADDBDCDCDCDADDCAABDBDAAAAAABDDDCCCD...
output:
2084
result:
ok single line: '2084'
Test #41:
score: 0
Accepted
time: 606ms
memory: 86392kb
input:
4033 4096 3072 DBACDBABBCDDACDAABCAACDBBBADCBBDDBBBADCBCDABCBAABDCBDCDCBDDCADDCDCAACCBBACDADBDABBACBCBDCBBACCDBDCBABDAADACBADAACAABDDDDDCDBCDCACDBABBBDABBADDBAADACAAABCBDBCBBBBBDBBBACCCACBBDADDAADBBDDCCBABCBBCAADBDCBDCCCCCCCCBCCDCDDAAAADDACADAAAADDDDACBDCADBCBCAACABABBABCCCAAAABCADBDDADCCACDCBBDCABC...
output:
1585
result:
ok single line: '1585'
Test #42:
score: 0
Accepted
time: 637ms
memory: 86376kb
input:
4031 4096 3072 BDCADCDCBDDBDCBDBADDAABDABCDDAAACABCDDCDCCBABCDDCBBAABCACBDBBADCABBDADBCBDBCDDADAABDBACADCACDBBDBCCBACACCDACCCDDBBDDACBBACCABDDAABCABCBDAADCBADDDBBADDCCDDCDCDBBCCCCAACAACDBACACBADCBCAAAADCBDBADBDACADCCCDACDBADAADCACACDCADDCDCDBDCCCADDCACBCBCACDDBDCADDDDDBCDCADDBABBDABBCBADACCACDCADBCB...
output:
2643
result:
ok single line: '2643'
Test #43:
score: 0
Accepted
time: 638ms
memory: 86356kb
input:
4030 4096 3072 CADBCAADADCABADCDADCDAABBCADADCCCCCABCDCADCDBCCAADADDAAABCADBADABBACCABABDDDADADBCDDADBADCCDCBABDACDCDCACCABBBDDCBCBDAACDCBACCBDDBDAAAAABCADBCCCADCACBACBAADACDCBCABCDBABDBCDDDCACDBADDDCCBDBDBACBDACABBCAABBCBCBDBADCDCDBAAAADCDDDCADABBCCACCCDDBDBBDDCACABABBDCCADCABADCACDBBBBCABABDDADCCD...
output:
1950
result:
ok single line: '1950'
Test #44:
score: 0
Accepted
time: 214ms
memory: 33412kb
input:
3455 1728 864 CBCCCCCCCBBCBBABABBBAABBCCAAAACAABAABBACBAACBCBCCCABACABACABCAACBBBBACCBBBBCABACBBBBCAAAABCBCBBACACACCAABCBBAABABAACCACCABABBACCCBCAAAACCABCCABCCCACCBCABCCBCABACAAACABBABCCAACBCACCCABCABCAAAACBAABABCACCBBABABCACCCBACBABCCBBBACCBCABBBAACCCACBCCCACCABCAABAAAAAACBBBBCCBBABCBCCACBAACACBCBB...
output:
2126
result:
ok single line: '2126'
Test #45:
score: 0
Accepted
time: 564ms
memory: 87872kb
input:
4095 4100 1024 BBBBAABBBABBABBBABBAABAAAAAABABBBABBBBBBAABAABABBABBAAAABABAABABBABBABBABBAABBBBBBABABABBBABBAAAABBBBBABABBBBBABBBABAABABBBABBBAAAAAAABBBBBBAABAABAABBBBBBABABBBBBBABBBBAAABBAAAAAABBBAABBBABBBAABBBABBBABBAAAAAABABBBABBAAABAAAABABABABBABBBBBABAABABAABBAABAAAABBBBAABBABAAAABBBAABAABABABB...
output:
1043
result:
ok single line: '1043'
Test #46:
score: 0
Accepted
time: 288ms
memory: 46748kb
input:
2047 4100 1536 DBDAAABBBABDACBCACACBBADDCBDBCBBDABBCBDDBCCDDDCBABBDCBDBBABDDBDCADACBCDACCAAABABCAAABABBBDBACABDADCABDDBDDDCCDCAABCDBCADCBDCCCAADCCBBDDBCBBDBABCCCAADCDACACBACABBDCADBBBAAAADADDDBDBAADBBCCBBABAACDADBCCCBADADCBCCCCAAABDAACABABACBCDABBBCDDADCADCCBCACABACCACCCCBDCDDBACBCCCAACAABBDDDACBDBC...
output:
600
result:
ok single line: '600'
Test #47:
score: 0
Accepted
time: 282ms
memory: 46648kb
input:
2047 4100 770 BBAADADBCBBDCBDACBABBCADDDCCBDDBDCBDCACDCDDDBDACBBCCABBCDDDBCDDDDDAACBADCCCDACCCDDDBADCCCCDCAABBDACBAACACCCAABCCCDCDBDCDADADCCDBDCBBCCBAADDCADCBBCBDCBBAACCAAAACCBDCABBAACBACADCAAACABDBCCBDAAADBCBBABBCBBCDCBCABCCCBBCCCCAAACABDBBBACAACBACABAACCDBDDACCAACDAABADAACBBBABCACABAABCAADCDDCBACB...
output:
907
result:
ok single line: '907'