QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#401624 | #944. Cubeword | nhuang685# | 50 | 843ms | 19892kb | C++20 | 2.7kb | 2024-04-29 04:07:26 | 2024-04-29 04:07:26 |
Judging History
answer
#include <bits/stdc++.h>
const int MOD = 998244353;
struct Mint {
int val = 0;
Mint(int v = 0) : val(v) {
if (val <= -MOD || MOD <= val) {
val %= MOD;
}
if (val < 0) {
val += MOD;
}
}
Mint &operator+=(Mint b) {
val += b.val;
if (val >= MOD) {
val -= MOD;
}
return *this;
}
Mint &operator*=(Mint b) {
val = (int)((int64_t)val * b.val % MOD);
return *this;
}
};
Mint operator+(Mint a, Mint b) { return a += b; }
Mint operator*(Mint a, Mint b) { return a *= b; }
const int MX = 16;
const int LEN = 10;
int main() {
std::cin.tie(nullptr)->sync_with_stdio(false);
int n;
std::cin >> n;
std::set<std::string> ss;
std::vector freq(LEN + 1, std::vector(MX, std::vector<int>(MX)));
for (int i = 0; i < n; ++i) {
std::string s;
std::cin >> s;
int len = (int)s.size();
int st = s[0] - 'a', en = s.back() - 'a';
if (!ss.contains(s)) {
freq[len][st][en]++;
}
ss.insert(s);
std::string t = s;
std::reverse(t.begin(), t.end());
if (!ss.contains(t)) {
freq[len][en][st]++;
}
ss.insert(t);
}
Mint ans = 0;
for (int len = 3; len <= 10; ++len) {
std::vector cur(MX,
std::vector(MX, std::vector(MX, std::vector<Mint>(MX))));
std::vector pre = cur;
for (int i = 0; i < MX; ++i) {
for (int j = 0; j < MX; ++j) {
// pre[i][j][i][j] = freq[len][i][j];
pre[i][j][i][j] = 1;
}
}
for (int i = 0; i < 2; ++i) {
for (int a = 0; a < MX; ++a) {
for (int b = 0; b < MX; ++b) {
for (int c = 0; c < MX; ++c) {
for (int d = 0; d < MX; ++d) {
for (int e = 0; e < MX; ++e) {
for (int f = 0; f < MX; ++f) {
cur[a][b][c][d] +=
freq[len][e][c] * freq[len][f][d] * pre[a][b][e][f];
}
}
if (i == 0) {
cur[a][b][c][d] *= freq[len][c][d];
}
}
}
}
}
std::swap(cur, pre);
cur.assign(MX, std::vector(MX, std::vector(MX, std::vector<Mint>(MX))));
}
// for (int i = 0; i < MX; ++i) {
// for (int j = 0; j < MX; ++j) {
// ans += pre[i][j][i][j];
// }
// }
for (int a = 0; a < MX; ++a) {
for (int b = 0; b < MX; ++b) {
for (int c = 0; c < MX; ++c) {
for (int d = 0; d < MX; ++d) {
ans += pre[a][b][c][d] * pre[a][b][c][d] * freq[len][a][b] *
freq[len][c][d];
}
}
}
}
}
std::cout << ans.val << '\n';
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 21
Accepted
Test #1:
score: 21
Accepted
time: 809ms
memory: 18996kb
input:
100000 aaa aaaa aaaaa aaaaaacb aaaaabfdab aaaaacaeba aaaaacbec aaaaacc aaaaacdde aaaaad aaaaaef aaaaafe aaaab aaaaba aaaabac aaaabcab aaaabdcab aaaabddec aaaabeabd aaaabeeacc aaaac aaaacaafee aaaacabec aaaacad aaaacb aaaacbcbba aaaacbddbe aaaacc aaaacdda aaaacdf aaaacecdca aaaacfceed aaaacfdef aaaad...
output:
966519702
result:
ok 1 number(s): "966519702"
Test #2:
score: 21
Accepted
time: 816ms
memory: 19148kb
input:
99999 aaa aaaa aaaaa aaaaaad aaaaabcee aaaaabecdc aaaaabecf aaaaacdfcc aaaaad aaaaadab aaaaaecaab aaaaaee aaaaafafd aaaaafccf aaaab aaaaba aaaabad aaaabada aaaabc aaaabcaecb aaaabd aaaabdfb aaaabede aaaabefedb aaaabfeaa aaaabffddb aaaac aaaacbbcc aaaacbec aaaaccb aaaaccbfee aaaaccde aaaacceb aaaacd ...
output:
884966963
result:
ok 1 number(s): "884966963"
Test #3:
score: 21
Accepted
time: 815ms
memory: 19232kb
input:
99998 aaa aaaa aaaaa aaaaaaa aaaaaae aaaaac aaaaaccb aaaaadb aaaaadcbd aaaaafedd aaaaaff aaaab aaaabadd aaaabbeb aaaabc aaaabceca aaaabcf aaaabd aaaabdce aaaabe aaaabf aaaabfab aaaabfad aaaabfeffb aaaac aaaacaecbb aaaacb aaaacbdb aaaacda aaaacdd aaaacdddaf aaaace aaaacecde aaaacfeff aaaacffe aaaad a...
output:
519865738
result:
ok 1 number(s): "519865738"
Test #4:
score: 21
Accepted
time: 839ms
memory: 19176kb
input:
99997 aaa aaaa aaaaa aaaaaa aaaaaac aaaaaaed aaaaab aaaaac aaaaad aaaaadbdf aaaaaf aaaaafc aaaaafe aaaaaffebf aaaab aaaaba aaaababaa aaaababdca aaaabacbcb aaaabae aaaabaeec aaaabc aaaabdb aaaabddeab aaaabfe aaaac aaaacbafdf aaaacbfbcb aaaaccfe aaaacd aaaacdfb aaaacecfaa aaaaceeea aaaacfbaf aaaacffb ...
output:
440905828
result:
ok 1 number(s): "440905828"
Test #5:
score: 21
Accepted
time: 803ms
memory: 18992kb
input:
99996 aaa aaaa aaaaa aaaaaaea aaaaab aaaaabaf aaaaabcb aaaaac aaaaacbcce aaaaadb aaaaadf aaaaaeaf aaaaaeb aaaaaef aaaaaefd aaaaafeee aaaab aaaabaacca aaaabb aaaabbdd aaaabc aaaabcc aaaabcdb aaaabcdbbb aaaabcdf aaaabce aaaabde aaaabdefb aaaac aaaacaee aaaacafa aaaacb aaaacbb aaaaccebfc aaaacd aaaacdf...
output:
606830795
result:
ok 1 number(s): "606830795"
Test #6:
score: 21
Accepted
time: 813ms
memory: 18928kb
input:
99995 aaa aaaa aaaaa aaaaaaa aaaaaaabcf aaaaaaaccf aaaaaaafb aaaaaad aaaaaaf aaaaab aaaaabecfc aaaaac aaaaacbc aaaaacc aaaaaceee aaaaacffc aaaaad aaaaadfccf aaaaaec aaaaaee aaaaaefaec aaaab aaaabaffab aaaabbaadc aaaabbd aaaabbed aaaabdcebd aaaabeacf aaaabedfc aaaabfcd aaaabfe aaaac aaaaca aaaacaf aa...
output:
293744889
result:
ok 1 number(s): "293744889"
Test #7:
score: 21
Accepted
time: 813ms
memory: 19000kb
input:
99994 aaa aaaa aaaaa aaaaaa aaaaaaab aaaaaabdd aaaaacbfb aaaaacfeef aaaaadab aaaaae aaaaaeaf aaaaaf aaaaafac aaaab aaaababdb aaaabb aaaabbadf aaaabbec aaaabccc aaaabde aaaabdffbf aaaabefdfa aaaabff aaaabffdf aaaac aaaacaf aaaacafed aaaacbeccd aaaaccbbb aaaacd aaaacdba aaaacddafb aaaacdf aaaacdfdc aa...
output:
745454877
result:
ok 1 number(s): "745454877"
Test #8:
score: 21
Accepted
time: 807ms
memory: 19244kb
input:
99993 aaa aaaa aaaaaa aaaaaaa aaaaaabdf aaaaabbee aaaaac aaaaaccfaf aaaaadbece aaaaafa aaaaafacb aaaab aaaabadda aaaabb aaaabbacd aaaabbea aaaabcddb aaaabdbff aaaabfb aaaabfee aaaac aaaaca aaaacbbc aaaacbecb aaaacc aaaaccbbec aaaaccc aaaacdcb aaaacddd aaaacdfcba aaaaceae aaaacecdfe aaaacfc aaaad aaa...
output:
429068770
result:
ok 1 number(s): "429068770"
Test #9:
score: 21
Accepted
time: 820ms
memory: 19224kb
input:
99992 aaa aaaa aaaaa aaaaaaccb aaaaaacdef aaaaaadfd aaaaaafd aaaaab aaaaabd aaaaabeee aaaaacda aaaaacf aaaaad aaaaadbca aaaaaeed aaaaafccfb aaaab aaaababb aaaabaddb aaaabafadc aaaabbb aaaabbd aaaabcd aaaabce aaaabf aaaabfa aaaabfbf aaaabfcac aaaabfd aaaabfde aaaabff aaaabffdc aaaac aaaaca aaaacae aa...
output:
289771162
result:
ok 1 number(s): "289771162"
Test #10:
score: 21
Accepted
time: 813ms
memory: 19196kb
input:
99991 aaa aaaa aaaaa aaaaaaad aaaaac aaaaacecbf aaaaacfa aaaaadcdc aaaaae aaaab aaaabafafe aaaabee aaaabeeb aaaabf aaaabfdcc aaaacaeffe aaaacc aaaaccab aaaacded aaaace aaaacea aaaaceaad aaaaceaecc aaaacfeb aaaacff aaaad aaaada aaaadaf aaaadba aaaadbfe aaaadc aaaadcf aaaadd aaaaddae aaaaddcf aaaade a...
output:
875542265
result:
ok 1 number(s): "875542265"
Test #11:
score: 21
Accepted
time: 799ms
memory: 19156kb
input:
99990 aaa aaaa aaaaa aaaaaba aaaaabdcd aaaaac aaaaacbfcf aaaaada aaaaaed aaaaaeeec aaaaafdc aaaaaffadc aaaab aaaabaddd aaaabceeeb aaaabda aaaabf aaaabfaffe aaaabfedcd aaaac aaaaca aaaacab aaaacabdfc aaaacaf aaaacbaea aaaacbb aaaacccbf aaaaccecaf aaaacdf aaaacede aaaaceebea aaaaceeddd aaaacfba aaaad ...
output:
236060052
result:
ok 1 number(s): "236060052"
Test #12:
score: 21
Accepted
time: 817ms
memory: 18960kb
input:
99989 aaa aaaa aaaaa aaaaaadfdd aaaaabee aaaaac aaaaacbb aaaaaed aaaaaedbe aaaaafae aaaab aaaababfa aaaabacb aaaabbcefd aaaabc aaaabccebb aaaabeaea aaaabeb aaaabeca aaaabed aaaabedb aaaabfaba aaaabfbdb aaaabfd aaaabfdf aaaabffeb aaaac aaaaca aaaacad aaaaccacbc aaaaccafaa aaaaccb aaaacdccc aaaacdff a...
output:
382736648
result:
ok 1 number(s): "382736648"
Test #13:
score: 21
Accepted
time: 821ms
memory: 19168kb
input:
99988 aaa aaaa aaaaa aaaaaacc aaaaaaeef aaaaab aaaaabfbdc aaaaabfdb aaaaaccdca aaaaacfbc aaaaadf aaaaaede aaaaaf aaaaafdbcd aaaaafea aaaab aaaabbae aaaabbbda aaaabbd aaaabbec aaaabc aaaabcacc aaaabcaeca aaaabce aaaabdbae aaaabdbb aaaabee aaaabfead aaaabfeefb aaaac aaaacb aaaacbbe aaaacccfaa aaaaccd ...
output:
778837075
result:
ok 1 number(s): "778837075"
Test #14:
score: 21
Accepted
time: 828ms
memory: 18932kb
input:
99987 aaa aaaa aaaaa aaaaaabe aaaaaacbbc aaaaaacecf aaaaaadc aaaaaaeffd aaaaab aaaaabf aaaaacab aaaaaccbaf aaaaacd aaaaacdeca aaaaacec aaaaaceda aaaaacf aaaaadc aaaaadefe aaaaae aaaaaeaab aaaaafabe aaaaafaf aaaaafddad aaaaaffccd aaaab aaaabafb aaaabdbca aaaabdebe aaaabecca aaaabfba aaaabfbb aaaabfbd...
output:
265167705
result:
ok 1 number(s): "265167705"
Test #15:
score: 21
Accepted
time: 815ms
memory: 18996kb
input:
99986 aaa aaaa aaaaa aaaaaa aaaaaaafc aaaaaabcfa aaaaaabdbb aaaaaabfd aaaaaadd aaaaaadf aaaaab aaaaabbba aaaaabcc aaaaacebdd aaaaad aaaaaddbcb aaaaaf aaaaafa aaaaafaaba aaaaafea aaaab aaaababdc aaaababfc aaaabaccbe aaaabb aaaabbcb aaaabbfecf aaaabdad aaaabe aaaabecea aaaabeddc aaaabfdbec aaaac aaaac...
output:
376583661
result:
ok 1 number(s): "376583661"
Test #16:
score: 21
Accepted
time: 834ms
memory: 18980kb
input:
99985 aaa aaaa aaaaa aaaaaa aaaaaadaed aaaaaae aaaaabbdb aaaaac aaaaadadba aaaaaeb aaaaaefdd aaaaafd aaaaafe aaaaaffde aaaab aaaababbda aaaabace aaaabaf aaaabbfcf aaaabcefad aaaabdacfb aaaabdef aaaabe aaaabeab aaaabfd aaaabfdbf aaaac aaaacbbef aaaacc aaaacd aaaacdae aaaacdfea aaaace aaaacec aaaacfbf...
output:
546456611
result:
ok 1 number(s): "546456611"
Test #17:
score: 21
Accepted
time: 815ms
memory: 19028kb
input:
99984 aaa aaaa aaaaaaca aaaaaaecf aaaaabdde aaaaabfc aaaaacaefc aaaaacbfed aaaaacf aaaaadcec aaaaadeabf aaaaafdee aaaab aaaabafecf aaaabbe aaaabdbde aaaabebac aaaabfe aaaabffa aaaac aaaacbbdb aaaacbe aaaaccead aaaacdaace aaaacdaf aaaacee aaaacfa aaaacfeae aaaad aaaada aaaadaddbb aaaadb aaaadba aaaad...
output:
82579691
result:
ok 1 number(s): "82579691"
Test #18:
score: 21
Accepted
time: 823ms
memory: 19212kb
input:
99983 aaa aaaa aaaaa aaaaaab aaaaac aaaaaca aaaaacbdd aaaaad aaaaadf aaaaae aaaaaeedbb aaaaaf aaaaafd aaaaafda aaaaba aaaabaccb aaaabada aaaabafba aaaabb aaaabbb aaaabcbf aaaabcc aaaabccea aaaabceec aaaabd aaaabdaeaf aaaabe aaaabead aaaabeafc aaaabefc aaaabefda aaaabfdce aaaaca aaaacabfd aaaacbaaf a...
output:
843794331
result:
ok 1 number(s): "843794331"
Test #19:
score: 21
Accepted
time: 822ms
memory: 19148kb
input:
99982 aaa aaaa aaaaa aaaaaa aaaaabfcd aaaaac aaaaacc aaaaacccde aaaaae aaaaaea aaaaaeaa aaaaaebce aaaaaec aaaaaf aaaab aaaabaa aaaabac aaaabae aaaabbc aaaabbdf aaaabbf aaaabc aaaabddaf aaaabdef aaaabfdcc aaaabfea aaaabff aaaac aaaacab aaaacb aaaacbfe aaaacc aaaacca aaaaccabe aaaacd aaaacdaefe aaaacd...
output:
73145981
result:
ok 1 number(s): "73145981"
Test #20:
score: 21
Accepted
time: 813ms
memory: 18880kb
input:
99981 aaa aaaa aaaaa aaaaaa aaaaaaac aaaaaba aaaaacd aaaaadf aaaaaef aaaaafae aaaaaffd aaaab aaaabbaca aaaabbedb aaaabc aaaabcc aaaabccd aaaabddd aaaabebbca aaaabebbe aaaabebbea aaaabec aaaabece aaaabedade aaaabeee aaaabfcba aaaac aaaacaacbc aaaacbbeda aaaacbe aaaacbfbd aaaacdd aaaaceeaa aaaacf aaaa...
output:
328200997
result:
ok 1 number(s): "328200997"
Test #21:
score: 21
Accepted
time: 843ms
memory: 18936kb
input:
99980 aaa aaaa aaaaa aaaaaa aaaaaaa aaaaab aaaaabb aaaaac aaaaacfcab aaaaaddd aaaaadfa aaaaaedfcc aaaaaf aaaab aaaabaa aaaabab aaaabb aaaabbd aaaabbfcb aaaabc aaaabcaccd aaaabd aaaabdacd aaaabde aaaabeec aaaac aaaacabeff aaaacadb aaaacba aaaacbc aaaacbcbc aaaacbd aaaaceceef aaaacf aaaacfb aaaacfcdec...
output:
975997785
result:
ok 1 number(s): "975997785"
Subtask #2:
score: 29
Accepted
Dependency #1:
100%
Accepted
Test #22:
score: 29
Accepted
time: 811ms
memory: 19664kb
input:
100000 aaa aaaa aaaadfnl aaab aaabf aaabgbohpg aaac aaadhgjebb aaadjfc aaaeigcc aaaekhec aaafgb aaaggn aaagifb aaahmjhb aaaj aaajokcjd aaakaiojjl aaakb aaalgb aaalpkf aaam aaamehmil aaane aaanmo aaaobb aaaogddkfh aaap aaapifl aab aaba aabakfm aabcb aabcbhb aabembjed aabf aabfmoppgf aabh aabhkj aabhl...
output:
79035388
result:
ok 1 number(s): "79035388"
Test #23:
score: 29
Accepted
time: 803ms
memory: 19644kb
input:
99999 aaa aaabdh aaablohf aaacfk aaacghba aaaeb aaaegajda aaaekcadaa aaaenk aaah aaahakeg aaajdnj aaalijda aaaog aaapbjco aaappo aab aabdhnenj aabdmh aabe aabegib aabegn aabepf aabfbmdgj aabg aabgcan aabi aabiblkg aabip aabjjf aablmkocob aablokne aabmmpop aabmpfloil aabplllfb aac aacafn aacaneggj aa...
output:
329231054
result:
ok 1 number(s): "329231054"
Test #24:
score: 29
Accepted
time: 808ms
memory: 19592kb
input:
99998 aaa aaaaen aaaam aaab aaacekneo aaad aaadpceei aaaeak aaaebgo aaaeipj aaaejh aaaenbnkjl aaafjjkl aaagjofbdd aaahbjfabn aaahojaf aaajglh aaakfhp aaako aaalifgce aaangcjh aab aabaja aabb aabbn aabbp aabfpb aabg aabghjcmhl aabhdgc aabhgfcjka aabiogng aabj aabjdm aabjikjp aabk aabldjhaib aabm aabm...
output:
680075672
result:
ok 1 number(s): "680075672"
Test #25:
score: 29
Accepted
time: 823ms
memory: 19636kb
input:
99997 aaa aaaaabioi aaaaeba aaaaggh aaabidpgja aaabldadp aaaddojl aaadfknb aaaeejeidd aaaelkfma aaaf aaafccc aaagaaj aaagmhefa aaahg aaaiddlkpk aaaiepe aaaiifphhc aaaj aaajjcea aaakfop aaakmkmfpg aaaldda aaalfnnald aaalg aaamamdi aaamgainnd aaan aaanlfjk aaanmh aaaongkppj aaap aaaphagn aab aabacfi a...
output:
179927059
result:
ok 1 number(s): "179927059"
Test #26:
score: 29
Accepted
time: 836ms
memory: 19884kb
input:
99996 aaa aaaaeipam aaaajo aaabb aaaebpicpi aaaeica aaafocddm aaahedddoj aaaidbjmll aaaiofick aaajhcod aaajopidmc aaakhifjp aaalalpmh aaaldnk aaalfpj aaamacj aaamcepgc aaaniogaab aab aababik aabcbamppg aabcidom aabclpa aabd aabeogdajh aabfgc aabgaoighc aabgdg aabgmnhod aabi aabk aabkce aabkfebdjn aa...
output:
654954751
result:
ok 1 number(s): "654954751"
Test #27:
score: 29
Accepted
time: 813ms
memory: 19568kb
input:
99995 aaa aaaaafhhh aaaai aaaapg aaabdhgpl aaabfibgb aaach aaacll aaadaioba aaadhkbkd aaaedh aaaeo aaagcfji aaagfgnoi aaagnnil aaahdo aaahjbjj aaahlepko aaahpin aaahpmkakc aaajgkik aaakagii aaakjof aaaoa aaaoihm aaaond aaaoph aaapeno aab aaba aabahmk aabbpf aabcbekcl aabcgl aabchhgfk aabfelo aabfmfd...
output:
902435619
result:
ok 1 number(s): "902435619"
Test #28:
score: 29
Accepted
time: 804ms
memory: 19680kb
input:
99994 aaa aaaaajgl aaabclkj aaabcnndo aaablhdge aaabp aaachca aaadpkgi aaaeffeejg aaaeo aaafpd aaagina aaagjag aaagnion aaah aaahillnnj aaahnjfelj aaaiblodcp aaaj aaakjiok aaamogpc aaanakpgfj aaanefpeai aaaondac aab aabcgn aabcncfc aabdnlpi aabe aabecckem aabeefjm aabeilddh aabfhk aabfpfp aabhccij a...
output:
662320487
result:
ok 1 number(s): "662320487"
Test #29:
score: 29
Accepted
time: 811ms
memory: 19884kb
input:
99993 aaa aaac aaacn aaaejehk aaafgpighb aaagnbd aaahmipjpe aaaiik aaaijei aaaikkamai aaakfchmg aaakjnak aaan aaaokmfoc aaap aaapfeggnj aab aaba aabafap aabalae aabbdag aabbleddmd aabdemg aabf aabgkjgc aabgnboh aabhggn aabifac aabk aabklkm aablbl aablc aabloajce aabm aabmc aabmipmad aabnfmld aabnpcf...
output:
21324870
result:
ok 1 number(s): "21324870"
Test #30:
score: 29
Accepted
time: 811ms
memory: 19640kb
input:
99992 aaa aaaaee aaaagcag aaaah aaac aaaciij aaad aaadlhoacc aaaehlhae aaaek aaafapo aaafe aaahmippb aaahobkfo aaaiajcll aaaing aaajbkop aaajebll aaaloobon aaampmmdlm aaao aab aabbmfid aabc aabebcdcc aabedhdama aabekcok aabhcgih aabhmieilf aabic aabildfgik aabjlalbnl aabk aabkf aablg aablojngjb aabm...
output:
298518050
result:
ok 1 number(s): "298518050"
Test #31:
score: 29
Accepted
time: 827ms
memory: 19604kb
input:
99991 aaa aaaajfd aaabo aaacnnpapc aaacpngcb aaadfcfian aaaekfipmb aaaelpnok aaaf aaafgekfh aaagkkge aaagpkkjom aaah aaahlj aaai aaaj aaajfjog aaakglbb aaalaifmp aaalh aaalple aaamelmd aaamkbj aaanfnh aaaofemfbd aab aaba aabaaghf aababd aabaogfmk aabbammpfh aabbdhkcfn aabboeee aabcgbo aabckdog aabea...
output:
738149247
result:
ok 1 number(s): "738149247"
Test #32:
score: 29
Accepted
time: 808ms
memory: 19864kb
input:
99990 aaa aaaa aaaalanik aaaamplbl aaabpagbd aaabpllhg aaac aaaca aaache aaacijipfo aaaemcpo aaaglp aaaig aaajipmhm aaajmphncp aaakfnhcne aaakkgoa aaaknjbhng aaalbm aaamelpjec aaamkbfmke aaamocok aaan aaaodocjef aaaoech aaapgape aaaphofg aaapoimfhh aab aabaglbj aabaoglp aabbab aabbgnjnh aabbngfn aab...
output:
311868864
result:
ok 1 number(s): "311868864"
Test #33:
score: 29
Accepted
time: 825ms
memory: 19572kb
input:
99989 aaa aaaadn aaade aaafcgpipg aaafhmpkbc aaafka aaagc aaaifne aaaj aaakakblda aaalhakph aaallop aaalmef aaamofij aaanacaf aaao aaaofccog aaaoniecjh aaapdc aaapgpigm aab aabbpibl aabchb aabcoe aabda aabdagiei aabe aabep aabfnjgf aabgkfhfpc aabgoljee aabgonmeeb aabhdlbnej aabhldkkcc aabhofce aabik...
output:
359590216
result:
ok 1 number(s): "359590216"
Test #34:
score: 29
Accepted
time: 815ms
memory: 19892kb
input:
99988 aaa aaaaklbcne aaadlp aaadnmfc aaagfkpikc aaahgkpm aaahocbc aaai aaaijpchl aaaka aaakco aaakhm aaal aaam aaamog aaan aaanhnfegi aaapggbdab aab aaba aabancjjf aabbimggc aabblieicg aabblm aabdcig aabdpkacp aabeeglba aabfcllbhk aabfpco aabgfbf aabh aabhh aabibik aabjdagpdh aabjhaogf aabjlo aabkmc...
output:
910605341
result:
ok 1 number(s): "910605341"
Test #35:
score: 29
Accepted
time: 808ms
memory: 19640kb
input:
99987 aaa aaaanjahgo aaabe aaac aaadck aaadhcpgf aaadponl aaaedeemf aaaegnaf aaah aaahbaf aaaiacl aaajafkjeb aaajji aaajmm aaalpbilod aaan aaapdeb aaapeinge aaapmh aab aabaflgcg aabaindmnp aabapkkofj aabbhn aabcm aabdhnjcn aabdlila aabedhmhin aabeh aabfl aabhl aabimgil aabjnpjg aabjpaeid aabk aabl a...
output:
240424831
result:
ok 1 number(s): "240424831"
Test #36:
score: 29
Accepted
time: 797ms
memory: 19708kb
input:
99986 aaa aaaaekmbcg aaaafia aaaapn aaac aaacdkbp aaackfikfe aaaeo aaagamjadc aaagepnkb aaagiab aaagoon aaah aaaia aaaihcpkm aaaiiaac aaaiob aaajlobbf aaakjdlde aaaknaa aaal aaall aaallj aaaloaapfa aaam aaamhka aaanhcg aaao aaapl aabal aabalj aabapl aabcacmljm aabcicfgec aabcpcdfha aabejc aabffgf aa...
output:
331433634
result:
ok 1 number(s): "331433634"
Test #37:
score: 29
Accepted
time: 831ms
memory: 19588kb
input:
99985 aaaae aaaahdb aaaamap aaabeid aaabm aaaccji aaadlfgcb aaaeejm aaafaken aaafjf aaafpaecb aaahm aaaiolkj aaaj aaajag aaajangcbf aaal aaalc aaamaknpno aaan aaanbpdo aaanpf aaaol aaaopcgbij aaapa aaapfjcdgh aaapli aab aaba aabbhcd aabbkfafb aabcj aaben aabf aabfffkl aabhnjii aabibegf aabifho aabjh...
output:
764432302
result:
ok 1 number(s): "764432302"
Test #38:
score: 29
Accepted
time: 811ms
memory: 19812kb
input:
99984 aaa aaaa aaaahcknpc aaaak aaaamaiam aaaamfgcml aaabekf aaac aaaceabd aaacigoc aaadnbhic aaaef aaafbe aaag aaahcfldom aaajfmp aaakoe aaalnma aaamp aaanan aaanhjbk aaao aaapgfn aaapmapfgi aab aabaj aabbahbldo aabcief aabdgjk aabdpfeea aabe aabei aabelcj aabem aabeomfjl aabffeggci aabfklim aabjjl...
output:
81244694
result:
ok 1 number(s): "81244694"
Test #39:
score: 29
Accepted
time: 803ms
memory: 19652kb
input:
99983 aaa aaaaocm aaab aaabl aaacin aaacl aaaclin aaadeecgm aaademmomc aaadlje aaaed aaafikfl aaagbjblfg aaaghi aaaghnbjd aaagjfie aaagmfdnke aaahdnc aaahm aaaihkfbbk aaajl aaajn aaakeaaem aaakedjap aaakgac aaanfn aaanjpoph aaanob aaaokcae aabab aababcc aabaeem aabaf aabamccbi aabbcbp aabbhl aabbiog...
output:
720412661
result:
ok 1 number(s): "720412661"
Test #40:
score: 29
Accepted
time: 812ms
memory: 19652kb
input:
99982 aaa aaaalamb aaab aaabekjfa aaabfl aaabgg aaadbdl aaadoc aaadpgjf aaaf aaafdcpj aaafhop aaag aaagi aaahgljpd aaai aaaj aaajbb aaajeg aaakjfha aaalg aaalpp aaamemlb aaamgl aaanbild aaaocko aaaoipfb aaapg aaapmncb aaapofbebm aab aaba aabafn aabahe aabao aabbhe aabblmf aabcill aabd aabdbig aabdck...
output:
562341742
result:
ok 1 number(s): "562341742"
Test #41:
score: 29
Accepted
time: 816ms
memory: 19584kb
input:
99981 aaa aaaa aaaaidbfkf aaaaigmcnk aaaao aaabchnkbf aaaca aaacehkoid aaadnjb aaaefg aaaencim aaaf aaafdkm aaah aaahigogjh aaahn aaahngnclm aaainlde aaaknkmhij aaamfkbpda aaamkhoded aaanjikh aaaoekllji aaapdaoine aaapgoich aab aabblh aabddclb aabddgdc aabepjg aabgcoldf aabghhmkl aabgnbh aabgpjfed a...
output:
517952580
result:
ok 1 number(s): "517952580"
Test #42:
score: 29
Accepted
time: 805ms
memory: 19592kb
input:
99980 aaa aaaakodoae aaadfegko aaadfekg aaadlk aaadoobmom aaae aaaebica aaaggkb aaah aaahadfe aaajlhnh aaakooc aaal aaaldg aaalec aaalhohj aaali aaaljape aaamdfloln aaamfnho aaamjmmbh aaammmpcc aaanhfb aaanj aaanjaj aaaogcdgp aaap aaapbpi aaapkhfjll aaapkih aab aabad aabbbj aabbodoaik aabbpikh aabcb...
output:
17075492
result:
ok 1 number(s): "17075492"
Subtask #3:
score: 0
Runtime Error
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Test #43:
score: 0
Runtime Error
input:
100000 AAAAOp AAALkO AAAaek AAAo AAB AABIPDEDlE AABJK AABKck AACBaBdfAf AACPKonI AADFgindcL AADaFggPmB AADamAhdl AAE AAEFlfkfcN AAFBHjK AAFClf AAFOGeH AAFbBJ AAFhJc AAFnFmB AAGN AAGgGioiG AAH AAHDHb AAHeIjic AAI AAIHdLa AAImDja AAJBejD AAJHjC AAKOG AAKc AAL AALHanIghO AALJK AALPnGOOCD AALp AAMF AAN ...
output:
result:
Subtask #4:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
0%