QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#865303 | #96. Random String Generator | m0NESY | AC ✓ | 8ms | 5504kb | C++14 | 3.2kb | 2025-01-21 16:35:30 | 2025-01-21 16:35:30 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 5, M = 11;
vector<int> vec[N];
inline void init()
{
for (int i = 2; i < N; i++)
{
int x = i;
for (int j = 2; j * j <= x; j++)
{
while (x % j == 0)
vec[i].push_back(j), x /= j;
}
if (x > 1) vec[i].push_back(x);
}
}
char s[N];
int n;
int x[M][1 << M], y[M][1 << M];
int f[M][N], g[M][N];
int now[M];
double p[M];
inline void update(int t, int x, int y, int v)
{
f[t][1] -= v;
f[t][x + 1] += v;
f[t][y + 1] += v;
f[t][x + y + 2] -= v;
}
inline int get(int l, int r)
{
int tmp = 0;
for (int i = l; i <= r; i++) tmp = (tmp << 1) + (s[i] - 'A');
return tmp;
}
int main()
{
init();
int T;
scanf("%d", &T);
while (T--)
{
scanf("%s", s + 1);
n = strlen(s + 1);
for (int i = 1; i <= n; i++)
for (int j = 1; j <= 10; j++)
{
if (i <= j) continue;
int S = get(i - j, i - 1), p = x[j][S], q = y[j][S];
int c = s[i] - 'A';
update(j, p, q, -1);
update(j, p + 1 - c, q + c, 1);
x[j][S] += 1 - c;
y[j][S] += c;
}
for (int j = 1; j <= 10; j++)
{
for (int i = 2; i <= n + 1; i++) f[j][i] += f[j][i - 1];
f[j][2] += min(n, j);
for (int i = 2; i <= n + 1; i++)
for (int k = 0; k < vec[i].size(); k++) g[j][vec[i][k]] += f[j][i];
}
for (int i = 2; i <= n + 1; i++)
{
int mn = 1e9;
for (int j = 1; j <= 10; j++) mn = min(mn, g[j][i]);
for (int j = 1; j <= 10; j++) g[j][i] -= mn;
}
for (int j = 1; j <= 10; j++)
{
p[j] = 0.1;
now[j] = 2;
while (g[j][now[j]] == 0 && now[j] <= n) now[j]++;
}
for (;;)
{
bool flag = true;
for (int j = 1; j <= 10; j++) if (now[j] <= n) flag = false;
if (flag) break;
double mx = -1;
int id;
for (int j = 1; j <= 10; j++) if (now[j] <= n && p[j] > mx)
mx = p[j], id = j;
p[id] /= (double) now[id];
double sum = 0;
for (int j = 1; j <= 10; j++) sum += p[j];
for (int j = 1; j <= 10; j++) p[j] /= sum;
g[id][now[id]]--;
while (g[id][now[id]] == 0 && now[id] <= n) now[id]++;
}
double ans = 0;
for (int j = 1; j <= 10; j++)
{
double tmp = 0;
if (n <= j) tmp = 1.0 / 2.0;
else
{
int S = get(n - j + 1, n), p = x[j][S], q = y[j][S];
tmp = (double) (p + 1) / (double) (p + q + 2);
}
ans += p[j] * tmp;
}
printf("%.15lf\n", ans);
memset(x, 0, sizeof(x));
memset(y, 0, sizeof(y));
for (int j = 1; j <= 10; j++)
for (int i = 0; i <= n + 1; i++) f[j][i] = g[j][i] = 0;
memset(now, 0, sizeof(now));
memset(p, 0, sizeof(p));
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 7ms
memory: 4736kb
input:
1000 ABBAABB BBBBBB ABBBABBBBAB BABBAABBAA BBAAABB BBBBAAAAAA AAABABBAB BABBABAB AAABABBAABAB BBAAABBAAA BAAABBABAB BBABAAAABBB BAAABBBAABBBA BBABBBBBBA BBAAAA ABABBAABABAAB AAAAAAAA AABAAABBABB BBAABAAABBB AAABBABBBBA BBBBBAAABAABBBBB BABABB BBBBBBBABABABA AABBABAAABBAAB BBAABBBAAABBAAA BBAAAABAABA...
output:
0.535227272727273 0.272121535181237 0.404859856846612 0.416573322131989 0.507317073170732 0.708069953645175 0.485347682119205 0.525157232704402 0.439159339945429 0.459065409638085 0.527258831521739 0.497506644618941 0.606366139996331 0.453848012564939 0.584375000000000 0.555415984361806 0.8346106208...
result:
ok 1000 numbers
Test #2:
score: 0
Accepted
time: 7ms
memory: 4736kb
input:
1000 AAAABAAABAAA BABBBB BABAABBBBBAA AABBAABBBBBB BBBBBB BAAAABAB AAAABBABABAA BBBBBAABBAAA BBBAABBAAB AABBAB BBABBBABAB AABAABBB ABBBBAABABAAA BBAABAAB BAAAAAAAAAAA AABAAABA BBBABBBABABBAB AABABBA AABABAAA AAAAAAAAAAAAAA AAABAABA ABBBBBBBBB ABABBBBBABAA AABBBAAAABBBB ABAA BABAAB ABBAABB AAAAAAAAA ...
output:
0.452153290339082 0.437500000000000 0.478523024385038 0.358496497215735 0.272121535181237 0.528547439126784 0.506305439777707 0.512509773260360 0.414653091704338 0.482352941176470 0.500000000000000 0.479384871155445 0.500000000000000 0.568860580325548 0.902540428987540 0.559177586023224 0.4705134869...
result:
ok 1000 numbers
Test #3:
score: 0
Accepted
time: 6ms
memory: 4736kb
input:
1000 BAAA AAABAAABAABB BBBABABBAA ABBBABABABAB AABBAABB ABABAABAABAB ABAAAAA AABBBBABBBAAB AAAAAAAAABBA ABBABABBBAB BBBBAAAB ABBABAABBBB BABBBABBABB BABBAB AAABBABBB AABABAAABAABAABBAABBAA AABAAAAAB AABBBAAB BBBBBBBB ABABBB AAABBAAA ABABBAAB BAAAABABAABB AABBABABBABBA BAAABAB BAABAAABBBB AABABABBBBA...
output:
0.548387096774194 0.504058510188552 0.496212021570433 0.680984817676562 0.562066525123850 0.655353059622539 0.616541353383459 0.459814798637197 0.573771745139322 0.507821312277864 0.489717223650386 0.476132635427884 0.531233799896319 0.470652173913043 0.491813064983797 0.375221939897507 0.5378955114...
result:
ok 1000 numbers
Test #4:
score: 0
Accepted
time: 8ms
memory: 4736kb
input:
1000 ABAAAABBBBAA BBBBBBBA BAAAAABBAAB BBABBBABA BABAABB BBAABAABBAAA BBAAAAAA BBAABBAABAB BBBABABABABA BBABBABAAAAAB ABAAABB AAABBABABB BBBBAABBBBA AAABBBBB AABABABAAB AAABAB ABAAABBAAABB BBABABABBAB AABAAABA AABAABABA ABAABAAABBA BBBABAAB BBABAAB BBABAAAABA AABAABBA BAAABAB BABABBB ABBBAB AABBABBA...
output:
0.518888303249721 0.500000000000000 0.482977642276423 0.465683905268246 0.505000000000000 0.490887931461397 0.713595106550908 0.502304792848740 0.228988548340291 0.502245666565300 0.500000000000000 0.524565054043119 0.563294797687861 0.363465160075330 0.600293908989561 0.521739130434783 0.6035111589...
result:
ok 1000 numbers
Test #5:
score: 0
Accepted
time: 7ms
memory: 4736kb
input:
1000 ABABAAA BBAAAAAAAAAA BABBAA ABB ABBAAABA AAAAAAAAA BAABBAB ABB AABABBBAB ABBBBBAAAAAA BBAABAAAA BBBABABBBBBBBA AAAAAAABAABAA AAABBAA BBABBBAAABABB BBABBAAAB AABBABABAA BAABAAAAAABABB BAAABBBAB BBBABBA ABABAAAABBABAB ABABBAABBAB AABBBAB AAABA BABABAAAAABB AAAABABABBBBBA ABABBBAAAABAAA AAAAAA ABA...
output:
0.515987210231815 0.884532670454546 0.500000000000000 0.483333333333333 0.508417508417508 0.866669758382414 0.492682926829268 0.483333333333333 0.481521024967148 0.665105925698495 0.538026721479959 0.412536167614173 0.525011887042090 0.509661835748792 0.462953396397388 0.488439974567944 0.4875929274...
result:
ok 1000 numbers
Test #6:
score: 0
Accepted
time: 5ms
memory: 4736kb
input:
200 BBBAAABBBAAABBABBAABAABAABAABAABAABA ABBABBABAABBABBBAAAAABABBAAAAAABABAAAAABAAAABABAA ABAABBBAABBABAAAAAAAAAAAAABAAABBBBABAA BBABAABBABABAAAAABBABAAAABBABAABBABBABAAAAABB BAAABBABAABBBABABABAABAABBBABABAABBBABAABBBABAABBBABABABABAABBBA BABBAABAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBBBBBBBBBBBABBAA...
output:
0.847258560519030 0.609010869807780 0.580223582138078 0.843295042518767 0.133407575055274 0.514275083270741 0.143468558164964 0.615944521620222 0.861259386863657 0.187938111126944 0.219433237559524 0.475969718042600 0.485727771236276 0.362010874101497 0.421494518014807 0.504491876512843 0.4663376977...
result:
ok 200 numbers
Test #7:
score: 0
Accepted
time: 6ms
memory: 4736kb
input:
200 BBBAAAAAAAAAAAABAAAABBBABABABABABABABABABBBAABBAAAAAAB BAAAAABAAABABAAAABAAABABAABAABABAABAAABAAABAABAABAABAA BBABAABAABBBAAAAAABABABBAABBBBBBABABAABBAABBBABBBAAAB AAABAAAAABABBBBAABABABBABBBBBAAABBAABBABAABBBBBAAAABAAAAABAA BBBAAAAAAAAAAAAAAAAAAAAAAAABBBAABBBAA BABBBBAAAAABBBBAAAAABAAAAABAABBAA...
output:
0.511039488494841 0.473801699276748 0.500162803380619 0.615249771212350 0.559168232117375 0.709557960434555 0.507687549000977 0.566142966950205 0.657856514622099 0.700900511595063 0.431341710101432 0.072878500937534 0.474605115068741 0.152707562633081 0.256073865445761 0.771469544819883 0.5585560876...
result:
ok 200 numbers
Test #8:
score: 0
Accepted
time: 6ms
memory: 4864kb
input:
200 BBBBABABAABAAAAAAAAAAAAABABBBAAAABABAABBABABAAABBBABABAABABAAABA ABAAAAAAAAABBABAAAABABAABAAABAAABAAABBBAABAAAAAABAAA BABBBABBAABABABAAABAABABBBAABBBBBAAAAA AAAAAABAABBABBBBAAAABABBAAAABABBAAABBAAABBBBABBBABA AAABABBABABBBABABBBBABAAABABAABBBABBABBBAAAAABAABAAA ABAAAAAABBBBBABAABBAABAAABAABBAAAB...
output:
0.379826101109181 0.636281398710618 0.500972107300991 0.500614728179025 0.498087173530596 0.550103795613856 0.976695734859833 0.552275669479973 0.444244189707717 0.092309471239744 0.359605964106406 0.375432718669134 0.845396548905443 0.527612580256822 0.591236850782699 0.850032282687344 0.5366819077...
result:
ok 200 numbers
Test #9:
score: 0
Accepted
time: 3ms
memory: 4608kb
input:
50 BABBABBAAAAAAAAAAAAAAABABAAAAAABAAAAAAAAAAAAABAAABABBBAAAAAAAAAAAAAAAAAAAAAABABBABAAAAAAAAABAAAAAAABABABAAAAAAAAABBBAABBAABBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAA ABBBBBABABABBABABABAAABBAAABAAABBAAAABABBABABABABAAABAAAAAAABAAAAABAAABBBABABBABABABBAAAABABABAAABBABAAAAAAAABBABA...
output:
0.912451577588449 0.931821668167523 0.500201436815071 0.891709127512467 0.645063406556140 0.189464550088030 0.332945424338851 0.501652991395474 0.499252268024349 0.266743380581738 0.556080807718818 0.744190594141422 0.495834054847198 0.544698381827413 0.334646047033658 0.497822164987949 0.4425871546...
result:
ok 50 numbers
Test #10:
score: 0
Accepted
time: 5ms
memory: 4864kb
input:
50 AAAABBAAAAABABBABBAAABBBABAABBAABBAABBBABBAABBBAABABBBBABAAAABBBABAABABABBAAABABABABBBBBAAAABBBBAABBBBABBABABBBAAABBBBAAABBBBABABABABBBABABBBBAABAAAABBBAABAABBBAABAABAABABAAABBABBBAAABBBBABBABAAABAABAABBABBABBBAABBBAAB BBABABABBABBBABABABABABABABABABABABABBABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
output:
0.711620279266463 0.676695340748126 0.936772449728334 0.524155958887803 0.643558972436508 0.569821573853306 0.167000493907530 0.333167014439813 0.485649647278076 0.831528004334026 0.379882303355728 0.333498742216242 0.489254815982111 0.859425501081331 0.918191861172233 0.601512441010476 0.7465162388...
result:
ok 50 numbers
Test #11:
score: 0
Accepted
time: 4ms
memory: 4736kb
input:
50 AAABBBBAAAABBABBBAABABBAAABBAABBBABBAABBAABBABBBAAABBAAABBABABBABAABBABAABBBBAABBBABABBBBABBAAAABAABBAABBBAAAAAAABBBAAAABAABBBABBBBBAAAAAAAABBAAAAAAAAAABBABABBABBAABBAABABABBBBBBBBBBABABBBBAAABBABAAAAAAAAABBAA AABAAABBBBBABABAABBAAABAABAABABBAAAABAABABAABABBBBABBABAAABBABBABBABBABBAAABAAAABABBAAA...
output:
0.591498227340581 0.500169961724569 0.524617913801183 0.109540907758602 0.451844813401729 0.470506842994887 0.459188777346677 0.809320541860015 0.214895868552526 0.167046988516394 0.253484203216106 0.954609874652118 0.066887433654707 0.353437468015567 0.899453055716389 0.307492339552716 0.4719808374...
result:
ok 50 numbers
Test #12:
score: 0
Accepted
time: 4ms
memory: 4608kb
input:
50 ABABABABBAAAABAABABABBAABABBAAAABBAAAAAAAABABBBBAAAABBBBBBBAABABBAABABBBBBBBBBBBBBAAABABBAAABABABAAABABBAABABBAABAABABBBBAABABBBBBBBBBAAABABBBBBAABABBAABAABABBAABABBAABAABAAAAABABBBBAAAABABBBAAAA BAAABBBBAABABBBABBAABBABBBABABABBABABAAAABBABBAABBBBBABBABAABBAABABBBAABABBBABBABAAAABAABABABBBBAABAA...
output:
0.540904316022252 0.522917667465956 0.367545868852264 0.747126312640832 0.264720027200587 0.494586657356534 0.180325141620618 0.749417793353277 0.251096630197927 0.455601668889355 0.249788431534324 0.346693853384867 0.357673490870255 0.666666949508210 0.691946990897431 0.973451137273548 0.4519005236...
result:
ok 50 numbers
Test #13:
score: 0
Accepted
time: 4ms
memory: 4864kb
input:
50 ABBABBAABABABBABBAAAABABAAAABABAAAABBBAAABAAABBABABBABBAAAABAAABABBBBBAABAABBAAAABAAABAABABBBABAABAAAAABBBAABBBAAABBBBBAABAABBAAAAAABBABABBABABBAABABAABBBAAABBBBAAAAAABBABABABABABAABABBBBABABAABAABABBAABA AABBBBBBBBBBBBBBAABBBABBBBBBAABBBBBBBBBBBBBBBBBBBBBBBBAABBBBBBBBBAABBBBBBBBBBBBBBBBBBAABBABB...
output:
0.277368541109681 0.093028199935591 0.227213790790155 0.520187106069604 0.771446674702296 0.499339806482972 0.036791446663633 0.640906032917336 0.418685339271904 0.333444833588385 0.365871021306790 0.502890413517141 0.800966452069119 0.833331671145737 0.598157990501263 0.440711511163226 0.2237091027...
result:
ok 50 numbers
Test #14:
score: 0
Accepted
time: 5ms
memory: 4864kb
input:
50 AABAAAABBBBBAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBABBBBBBABBBBBAABAAABABAABBABABBAABBBABBBBBBABAABAAAAAAAAAAAAAAAABBAABAABBBABBABBBBBABAABAABAAAABAABAABBABBABBABBBAABABABAABBABBABBABBABBABBABAABBABABBAAAABBAABABBBA BBBABABABBAABAAABBAAAABBABBAABABBABBABABAAAABAABBAAAAAABABBABBBABABAABBABAAABABAB...
output:
0.624454730814077 0.578386339725887 0.312295113350599 0.666660369209512 0.749991849355410 0.493961989511526 0.794664962744088 0.692404595619904 0.958666057656219 0.719862814046741 0.084980774587881 0.645540423596236 0.832493841921779 0.898632637638403 0.119914787614806 0.487922126942977 0.2818792759...
result:
ok 50 numbers
Test #15:
score: 0
Accepted
time: 2ms
memory: 4736kb
input:
10 BBBBBAABBAAABBBBAAABBBBBAAAABBAABBBAABBBAABBAAABBAABBAABAAABBAABBAABBBBAABBAAABBAABAABBAABBBBBBBBBBAAABBAABBBAABBBBBBAAABBAABBAABAABBBBAABBAABBAABBBBBAABBAAABBAAABBBBBBABBBBBBBAABBBBBAABBBBAABBBAAABBBBBAABBBAABBAABBBAABBAABBBAAABAABBBBABBAAABBBBAABBBBBBBBBAABBBAABBBABBAAABBAABBBAABBBBAABBBABBAABB...
output:
0.956737378292499 0.120000000000000 0.150889512398077 0.490203315930686 0.533640740627570 0.105263981268964 0.333333333333333 0.230769230773951 0.460534690634164 0.878261221855462
result:
ok 10 numbers
Test #16:
score: 0
Accepted
time: 5ms
memory: 4736kb
input:
10 BBBABBBBBBBBBBBBBBBBBAABAAAAAAAAABABABAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBAABABAAAAAAAAAAAAAAAABBBBBBBBABBAABAABABABABABBBBBBBBBBBBBBBBBBAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABABABABABABBAAABABABABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBAABABABABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBABBA...
output:
0.063775944835570 0.113332138897977 0.444444444444444 0.127916998244792 0.333333333333333 0.214285757880843 0.652173955088515 0.575336632816565 0.857142857142781 0.205714488685458
result:
ok 10 numbers
Test #17:
score: 0
Accepted
time: 3ms
memory: 4864kb
input:
10 BBABABBBAAABABBABBBAABBAAAABABBAAAABABBBBBBBBBBBBAAAABBAAAABBAABBABAABBBAAAABAABABBAABBAABBAAAABBBAABABAABBABAABABAABBAAAABBAABBABABABBBAABBBAABBABAABBBBBBBBBBBBBBBBBBAAAABABBAABBABAABBABBBABABBBAAAABABAABBAABBAAAABBAAAABAABBAABBAAAAABBAAAABBBAABBAAAABAABBABBBAAAABBBAAAABBAABBABAABBAAAABABABBBAAB...
output:
0.951612903225806 0.966514317638179 0.499999231257742 0.515151516865055 0.058823531952893 0.500000000000000 0.769230769230769 0.499999998320034 0.752029995519600 0.499999999998405
result:
ok 10 numbers
Test #18:
score: 0
Accepted
time: 3ms
memory: 4736kb
input:
10 BBBBABBABBAABAABABAABABAABAABABBAABAAABBBBBBBABBABBABAAABBABAAABBBBAAABBBBABBBBBABBBBABBABABBBAABBBAABBBBABBABAAABBABBAABAABAABAABAABABAAABBBBABBABAAABBAABAABAABBBAABAABABABAABABBBBABABBABBABAAABBBBABBBBBBABABBABABBABBBBBAAAAAABBAABAAABBAABABAABBBAABAABABAABABAABAABABAABABAABABABBABAAAABABAABABAA...
output:
0.620689726761607 0.070249703957010 0.537383749914827 0.222222066840192 0.775510996616775 0.833409422010770 0.831609563523346 0.672126399329742 0.695659615207916 0.387256658243775
result:
ok 10 numbers
Test #19:
score: 0
Accepted
time: 3ms
memory: 4864kb
input:
10 BABAABBAAAABBABAAAAABBBABBBABBBBABBBBBBBBBBBABBBBABBBBBABBBABBBBBBBABBBAABBAAAAABBAABBABBBBBBBBBBBBBABBBBBBABBBAABABBBBBABBBBABBBAABAABBAAABABBBABBBABBBABBBABBBBABBBABBBBABBBBABBBABBBBABBBABBBABBBBABBBAABABABBBBBABBBBBABBBBBBABBBBBBBABBBAAAABBAAABBAABABABBBABBBBBBBABBBBBABBBBBBBBBBBABBBBABBBBBBBA...
output:
0.014705886502177 0.333333333333333 0.949247522521959 0.216629915986823 0.991521345956993 0.480263532386563 0.302210952619979 0.500000000000000 0.767365675905188 0.943946196991479
result:
ok 10 numbers
Test #20:
score: 0
Accepted
time: 5ms
memory: 4608kb
input:
10 BBBBBBBABBBBAAAAABBBAABBABBBBABBBBBBABABBBBABBBBBBAAABAAABBBAABABBBBAAABAAABBBAAABBAABABBABABAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBAABBABBBBBBABBBAABBAAABAAAAAAAAAAAAAABBBAABAABAAAAABAAAABAAAAAABBAABABBABABAAABABBABABAAAAABAAAAAAAABBAABBBBBAAAAAABBBAABBABBAAABBABBBBBBAAAAAAAAAAAAAAAAAAAAAAA...
output:
0.833333333331995 0.444444449872696 0.784257348048568 0.797101449275362 0.888540377400516 0.621621621621622 0.647058759548269 0.732672173419437 0.199999999864166 0.915046485639871
result:
ok 10 numbers
Test #21:
score: 0
Accepted
time: 4ms
memory: 4864kb
input:
10 BAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAABBAABAAAAABAABBBBBBBBBBBBAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAABAAAAAAAAAAAAAAAAAAAAAAAAAAAABAABAAAAAAAAAAAAAAAAAAABAABBAAAAAAAABAAABAAABBAABAABAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABAABBAABAABAAAAAABAABAABAAAAAAAAAAAAA...
output:
0.036900623296001 0.241379305067522 0.721174543577644 0.142857153198893 0.499999758050393 0.079011516960793 0.418308963440112 0.624204277324410 0.142857560873401 0.534251289755309
result:
ok 10 numbers
Test #22:
score: 0
Accepted
time: 5ms
memory: 5376kb
input:
1 ABBBABBAABBAABBAAABBABABABAABBBBBABBABAAAABBBABBAABBAABBBBBABBABBAAABABABBBBAAABBBBBBAAABABAABBBBBABBAAABBBBBBBAAABAAAABBBAABABAABABBABAAAABBBAABBBBABAAAAABAABABABAABBAABBAABABBBBAAABBAABBBAAABAAAABBBABAABBBABBBBBBAAABAAABBBABAABBBBBBABBABABBBAABAABAABAABBBAAAABABABABBABABBBAABABAABABBABAAAABBBABB...
output:
0.833333333333333
result:
ok found '0.8333333', expected '0.8333333', error '0.0000000'
Test #23:
score: 0
Accepted
time: 3ms
memory: 5376kb
input:
1 AAABBBBABBABABAABABBAABAABAAABBABABAABABAAABBABABBBBBBBBABABAAAAAABAAAABBABABAAAABBABABAAABBBBBBBBBBBBBBAAABBBBBBBBABABBBAAABABBBBBBBBBBBABBBAAABBBBBBABBAAABBBBBABABBBAAABBABABAAABBABABBABABBABABBBAAABBABABAAAABABAABABAABAAAABBAAAAABBBABBAABAAAABABBBAABAAAAABBABABAAABBABABAAABBABABAABAAAABABAAABBA...
output:
0.768421052631579
result:
ok found '0.7684211', expected '0.7684211', error '0.0000000'
Test #24:
score: 0
Accepted
time: 5ms
memory: 5504kb
input:
1 ABABBABBABAAAABBAABABBAABABBAABABABABABABBAABABABAABAABBAAABABBABABABBAABABABABBAAABABABABABABABAABBABABBAAABBABABABABBAAABABABABAAABABABABBAAABBAAABBAABBAABAABBAAABABBAABBAAABABABAAABABABABBAABAABBAAABBAAABAAABBAAABBABABBABABBAABABAABBAAABABABAABBAAABBAAABABAAABABABABABAAABABAAABABABABABBAAABABBA...
output:
0.390181736710409
result:
ok found '0.3901817', expected '0.3901817', error '0.0000000'
Test #25:
score: 0
Accepted
time: 4ms
memory: 5504kb
input:
1 AABAAABBBBBBBBBBABBBBBBBBABABAAAAAAAABBBBBBBBBBBBBAABAABBBBBBBBBBBABAAABBBBBBBBAABBAAAAABBAABAAAAAABAAAAABABAAAAABBBBBBBBBBBAABAAAABBABBBBBBBBBAABBABBABBABAAABAAABABBABBBBBBAABAAAAABBAAABABAAAAABABBAABBBABBABBABBABBABABABAAABABBAABBAABBBBBBBBBBBBBBBAABAAAAABABAAABABAAAAABBBBABBAAAAAAAAAAAAAABBBBBB...
output:
0.312351543942993
result:
ok found '0.3123515', expected '0.3123515', error '0.0000000'
Test #26:
score: 0
Accepted
time: 4ms
memory: 5376kb
input:
1 AAABBAABBBBBAAABBAAABBAAABAABBAAAABABABAAAABABBAAABAAABBAAABAAABBAAAABABBBBBABAAABABABAABBAABBBBBABAAABBAAAAABAABBBAAAABABAABABBAABAABABBBBBAABABAABABBAABAABBBAAAAABAABBBBABBBABBABBBBABBBBABBBAAABBAAABBABAAABBAABBBBABBBAAABAAABBAAABBAAAABABBAAAABBABAAABABABAAAAABAABBBABBABBAAAABABABABBBABBABAAABBA...
output:
0.150000000000000
result:
ok found '0.1500000', expected '0.1500000', error '0.0000000'
Test #27:
score: 0
Accepted
time: 3ms
memory: 5376kb
input:
1 AABABABABBBBAABBABBAAAAAABAABBAABABABAABBAABAAABBBBAABAABBAABABBABABABABABAABBBBAABABBABABBBBABBAAAAAABAABBAABABABBABAABBBBAABAABAAAAABAABBAABAABAAAABAABBAABAABBAABABBABAABBBBAABBABABBBBAAAAAABAABBAABBABBAAAABABAAAABABBABABABAABAAAABABABABAABABABBAABBABBAABBABABABABAAAAABBBABBBBABBABBAAAABAAABBBBB...
output:
0.990825688073395
result:
ok found '0.9908257', expected '0.9908257', error '0.0000000'
Test #28:
score: 0
Accepted
time: 6ms
memory: 5376kb
input:
1 BBBBBBBBBABBABABBBABBABBAAAAABBBABAAAABBABABABBBBBBBBBAAABBBBABABBAABAABBBAABBBBAABAABBBBBAABABBAABAABBAAABAABAAABABBBAABABABBABABBBABBAAAAAAAAABAAABAAAAABABABBBAABAAAABBABBBAABBABBAAAABBABBAABBBAABABABBABBBAAAAAABABBBBAABBBABBABBAAAAAAAAABAAABBBBBBBBBAABABBBBAABBBABABAAAABBABBBAAAABBABBBAABABABBA...
output:
0.642857142857143
result:
ok found '0.6428571', expected '0.6428571', error '0.0000000'
Test #29:
score: 0
Accepted
time: 4ms
memory: 5504kb
input:
1 AAABAAAAABBAABBABABBABABAABBBBAABABBBBABBABABABBABBBABABABBBBABBBBBABAABBBABABABABABABBABBABABAABBBBABBBBBBABABBBABBBABABABBABABAAABBABABABBBBABBBBBBABBBBABAAABABABABBBBBBBABABABABABABABBABABBBBBBABBBBBABAAAAAAABABBABABBBBBBABBBBABBBBBBBBBBBBABABABABABABABABABABAABBAABABAABABBBABABABBAAAAABBBABBBA...
output:
0.133089149657384
result:
ok found '0.1330891', expected '0.1330891', error '0.0000000'
Test #30:
score: 0
Accepted
time: 1ms
memory: 5376kb
input:
1 BAABBAABBAABBAABABBABABBABBABABBABBBAABABBAABBAABBBAAABABBAABBAABAABBBAABBAABBAABBAABABBAABBABBAABABABBAABBAAABABBABABBAABABBAABBAABBABABBBAAABBABBAABBAABBAABBAABBBAAABBAABABBAABABABBAABBAAABBAABBAAABABABBAABBAAABABBAABABBAABBAAAABBAABABABABBAABBAABABABABABBAABABBAABBAABBAABBABBAABABBABBAABBAAABBA...
output:
0.131956912263592
result:
ok found '0.1319569', expected '0.1319569', error '0.0000000'
Test #31:
score: 0
Accepted
time: 5ms
memory: 5376kb
input:
1 BAABBAAAAABAABAAABBABBABBBAAABABBABAABBAABABBAAABBABABABABAABBBABBABBABBAABBAAAAABBBAAABBABBBBBAAABBBBABAAAAABBAAABBABAABAAABABAABBBBABABBBABBAABBAAAAAABBBAAABBBBBAAAABAABBBBBABBAAAAAABBBABAABABABAABAABBBBBABAAAAAAAAAAAAABBAABBBBAAABAAABBBABABABAABBABBBAAABABAABABBBBABBABBBAAABAABBABBBAAABAABBBAAB...
output:
0.166666666666667
result:
ok found '0.1666667', expected '0.1666667', error '0.0000000'
Test #32:
score: 0
Accepted
time: 5ms
memory: 5376kb
input:
1 BABBAABABBBAABABAAAAAABAAAABBABBAABBAAAAABBAAAABABBBBABABBBBBABBBBABAAAAABBBABBBBBABBBABAAAABBABBAAABAAAABBABAAAABBABBBAAAAABBBABBAAABBABABBBBBABABABAAABBABBBAAAABAABBBAAAABBAABAABBBAABABABAAABBBABBABBBBBAABABABBBBABABABAAABBBABBABABBBBABABABAAABBBABBBBBAABABABBBAAAAABBBBAABBAAAAABABBABBABBAAABBBA...
output:
0.823943661971831
result:
ok found '0.8239437', expected '0.8239437', error '0.0000000'
Test #33:
score: 0
Accepted
time: 3ms
memory: 5504kb
input:
1 BAABBABABBAABABBABBBAAAABABBBAABABAAAABAAABBAABBBBABAAAAABAABBBBBAAABAAAABABBBAABBBBAABAABAABABBABBBBBBBABAAAAAAAABABABAAAAAAAABAAAABBAABBAABAAAAAAAAAAAAAAAAAAAABBBBBBABBBBBBABBBABBBAAABBAABBAABAAABABBBABBABBBAABBBAAABBAAAAABAAAABBBBABABAAABABBBAABABABABAABBBBBAAABABABABABAABBBBBAAAAAABAABBBABABAA...
output:
0.500000000000000
result:
ok found '0.5000000', expected '0.5000000', error '0.0000000'
Test #34:
score: 0
Accepted
time: 2ms
memory: 5504kb
input:
1 ABABBABAABBBAAABBBBABABBBABBBBBBABAABAABBBABBBAAAABBAABBBAAAABBAABBBABBBAAAABBAAABAAAAAAAAAAAAAAABBABBABBAABBBBABABAAABBBBAABBBBAABAABBBAABBBAABBBBAAAABBABBABAABBBABBBABBBBABBBAABBBABBBAAAAABAAABAAABBBBBBABBBBABBBABBBBAABBBBABABBABBABAABAAAAABAAABBBBBABBBAABBBAABBBBBABBBBABBBAAAAABAABBBAAAABBBBBAB...
output:
0.305810397553517
result:
ok found '0.3058104', expected '0.3058104', error '0.0000000'
Test #35:
score: 0
Accepted
time: 3ms
memory: 5376kb
input:
1 BBBBAAABBAAABBBBABAABBAAABBBAAAAABBBAAABBBBBAABBBBBBBBBBABBBBBBBBBBBAABAAABBBBBAABABBBAAABBBBBAABBBABBBBBBBBBBBBBAABBBBBAAAAABBABAAAAAABBBAAAABBBAAABBBAABBBBAAABBBBBBBBBBBBABBBBBBBAABBBBAAAAAAAAABABBBBBABBBAABABBBBAAAAAAABAAAAAABBBBBBBBBBBBBAABBBBBAAABAAAABAAABBBBBBBABAAABBBBBBBABBBBABBBAAAAABBBAB...
output:
0.604606739665619
result:
ok found '0.6046067', expected '0.6046067', error '0.0000000'
Test #36:
score: 0
Accepted
time: 4ms
memory: 5248kb
input:
1 AAABAAABAAAAAAAAABAAAAAAAAAAABAAAAAAAAABABAAAAAAAAABAAAAABAABBABAAAAAAABABAAABAAAABBAAAABAABAAAAAAAAAAAAAAABAAAAAAABAABBABAAAAAAAAAAAAAAAAABAAAAAABBAABAABAABAAAAAAABABAAABBAAAAAAAAAABAAAAAABAAAAAABAABAABAAABAAABABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAABABBAAAABAAAAAAAAAAABABAAAAAAAABAAAAAAAAAAAAAAB...
output:
0.793208567149913
result:
ok found '0.7932086', expected '0.7932086', error '0.0000000'
Test #37:
score: 0
Accepted
time: 5ms
memory: 5248kb
input:
1 ABBABAAABBBAAAABABBBBAAABAAAAABAABBBBBBAAAABABBBBBBAAABAAAAAAABBABABABABABBAAAABBBABBABBAABAABABABBAABBAABAABAABAABABABBAAABBABBBBABBBABBABBBAABAABBAABAABABABBAAAABBAAABABBABBABAABBAABABBBBBBAABBABBBBABBAABAABBABABAABBBAABBBBAABABBBBBBAABAABABABAAABBBBBAAABAAAAABAABAABABABBAABAABABAAAAABBABABAABBA...
output:
0.557142857142857
result:
ok found '0.5571429', expected '0.5571429', error '0.0000000'
Test #38:
score: 0
Accepted
time: 4ms
memory: 5376kb
input:
1 ABABABBBAABBAAAABBAABAAAAAABBBBAAAAAAABAABBBBABABABABABBBBBBBABBBAAABAAAAABBBBBAAABABBBBABBABABBBBAAABBABBABAABAAAAAABABABAAABABAAAAABBBBAAAAAAAABAABBBAAAAABBAAAAABBBAABABABBABBBABABBAAAAABBBBAAAABBAABBAAABAABABAAAAABBBAAABAAAABBBBBAAABABBBBABBBBBAABAAABBBAAABBABBAABAABAAAAAABBAAAAABBBBAAAABBAAAAA...
output:
0.500000000000000
result:
ok found '0.5000000', expected '0.5000000', error '0.0000000'