QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#361937#8515. KMOPucup-team1516#AC ✓65ms136432kbC++203.6kb2024-03-23 13:40:152024-03-23 13:40:16

Judging History

你现在查看的是最新测评结果

  • [2024-03-23 13:40:16]
  • 评测
  • 测评结果:AC
  • 用时:65ms
  • 内存:136432kb
  • [2024-03-23 13:40:15]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define db double
#define pii pair<int,int>
#define pli pair<ll,int>
#define pil pair<int,ll>
#define pll pair<ll,ll>
#define ti3 tuple<int,int,int>
#define int128 __int128_t
#define pii128 pair<int128,int128>
const int inf = 1 << 30;
const ll linf = 1e18;
const db EPS = 1e-10;
const db pi = acos(-1);
template<class T> bool chmin(T& x, T y){
    if(x > y) {
        x = y;
        return true;
    } else return false;
}
template<class T> bool chmax(T& x, T y){
    if(x < y) {
        x = y;
        return true;
    } else return false;
}

// overload macro
#define CAT( A, B ) A ## B
#define SELECT( NAME, NUM ) CAT( NAME, NUM )

#define GET_COUNT( _1, _2, _3, _4, _5, _6 /* ad nauseam */, COUNT, ... ) COUNT
#define VA_SIZE( ... ) GET_COUNT( __VA_ARGS__, 6, 5, 4, 3, 2, 1 )

#define VA_SELECT( NAME, ... ) SELECT( NAME, VA_SIZE(__VA_ARGS__) )(__VA_ARGS__)

// rep(overload)
#define rep( ... ) VA_SELECT(rep, __VA_ARGS__)
#define rep2(i, n) for (int i = 0; i < int(n); i++)
#define rep3(i, a, b) for (int i = a; i < int(b); i++)
#define rep4(i, a, b, c) for (int i = a; i < int(b); i += c)

// repll(overload)
#define repll( ... ) VA_SELECT(repll, __VA_ARGS__)
#define repll2(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repll3(i, a, b) for (ll i = a; i < (ll)(b); i++)
#define repll4(i, a, b, c) for (ll i = a; i < (ll)(b); i += c)

// rrep(overload)
#define rrep( ... ) VA_SELECT(rrep, __VA_ARGS__)    
#define rrep2(i, n) for (int i = n - 1; i >= 0; i--)
#define rrep3(i, a, b) for (int i = b - 1; i >= a; i--)
#define rrep4(i, a, b, c) for (int i = b - 1; i >= a; i -= c)

// rrepll(overload)
#define rrepll( ... ) VA_SELECT(rrepll, __VA_ARGS__)
#define rrepll2(i, n) for (ll i = (ll)(n) - 1; i >= 0ll; i--)
#define rrepll3(i, a, b) for (ll i = b - 1; i >= (ll)(a); i--)
#define rrepll4(i, a, b, c) for (ll i = b - 1; i >= (ll)(a); i -= c)

// for_earh
#define fore(e, v) for (auto&& e : v)

// vector
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

int N;
string W[1000010];
int dp[1000010][4][3];
vector<int> V[1000010];
string AEIOUY = "AEIOUY";
int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    cin >> N;
    rep (i, N) {
        cin >> W[i];
        rep (j, 4) rep(k, 3) dp[i][j][k] = inf;
        V[i].resize(W[i].size(), 0);
        rep (j, W[i].size()) {
            fore (u, AEIOUY) {
                V[i][j] |= u == W[i][j];
            }
        }
    }

    dp[0][0][0] = 0;
    rep (i, N) {
        rep (j, 4) {
            rep (k, 3) {
                if (dp[i][j][k] == inf) continue;
                // 次の文字列へ
                if (i + 1 < N && j > 0) {
                    if (V[i + 1][0]) {
                        chmin(dp[i + 1][1][0], dp[i][j][k] + 1);
                    } else if (k + 1 <= 2) {
                        chmin(dp[i + 1][1][k + 1], dp[i][j][k] + 1);
                    }
                }
                // 文字列を伸ばす
                if(j + 1 <= 3 && j < (int)W[i].size()) {
                    if (V[i][j]) {
                        chmin(dp[i][j + 1][0], dp[i][j][k] + 1); 
                    } else if (k + 1 <= 2) {
                        chmin(dp[i][j + 1][k + 1], dp[i][j][k] + 1);
                    }
                }
            }
        }
    }

    int ans = inf;
    rep (j, 1, 4) rep (k, 3) {
        chmin(ans, dp[N - 1][j][k]);
    }

    if (ans == inf) {
        cout << "*\n";
    } else {
        cout << ans << '\n';
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 7ms
memory: 37812kb

input:

3
KNUTH
MORRIS
PRATT

output:

4

result:

ok "4"

Test #2:

score: 0
Accepted
time: 0ms
memory: 38764kb

input:

3
KNUTH
M
PRATT

output:

5

result:

ok "5"

Test #3:

score: 0
Accepted
time: 0ms
memory: 38948kb

input:

3
K
M
P

output:

*

result:

ok "*"

Test #4:

score: 0
Accepted
time: 0ms
memory: 38284kb

input:

2
K
M

output:

2

result:

ok "2"

Test #5:

score: 0
Accepted
time: 5ms
memory: 37020kb

input:

4
YOU
SHOULD
BE
DANCING

output:

5

result:

ok "5"

Test #6:

score: 0
Accepted
time: 65ms
memory: 136432kb

input:

1000000
Y
E
U
O
I
E
I
E
E
Y
I
I
E
Y
E
U
U
O
A
I
U
O
Y
I
Y
Y
U
A
O
E
U
I
A
U
U
I
A
I
U
A
Y
I
E
U
I
O
Y
U
Y
Y
I
E
O
Y
E
A
U
O
O
I
A
E
I
I
Y
U
A
E
Y
Y
A
O
O
Y
A
U
E
A
O
I
O
Y
A
E
I
U
I
E
Y
O
U
O
I
I
Y
E
I
A
Y
U
I
I
Y
E
E
U
O
O
U
A
I
Y
A
I
I
E
O
O
A
A
I
U
I
U
O
E
U
I
E
A
O
E
A
I
O
O
Y
I
U
U
A
I
A
Y
O
A
...

output:

1000000

result:

ok "1000000"

Test #7:

score: 0
Accepted
time: 12ms
memory: 43100kb

input:

1
XAJFUEEIIUOQRUJKBDJUWYSAKPTOCXEUYMYGDOKOAGKXUYPYJYALCCXMPWSAUETUHBAOAIYIGKFLGUJVVNQOANJOYIYTXYNAIKAPEIAHVHQZINSOYPJLEBIJOGNAYWFUEIFDSNLSYEXYYAYZRTEUUEFXBUMOQIYESPKYTACAUXFLYIUYIDOUGOADUHKWOHEIEYUWENJPTOOIXMGAWOYZBMLUAKSIUEUEEECSUAFILCXIOOYIIYNMGYATUAIMZUCHXAKIUVALUMFIEUWUKWFRWALUYIDEQKNAETXEWETEGA...

output:

1

result:

ok "1"

Test #8:

score: 0
Accepted
time: 30ms
memory: 72780kb

input:

333333
SNE
NGO
NJA
JCE
XMU
WBE
ZZO
LTY
RHY
XZU
XZY
HXI
ZPU
FWE
HLA
BFE
NHY
ZPE
WJO
QVU
KGY
DLA
BDI
CSY
WXU
XGU
GQE
CTY
WQU
FHI
KLY
PCI
VDO
BQA
WCU
KQE
FLA
TCI
PHO
GDU
RCO
PKI
HFU
MVA
SRA
KGO
JTI
NNE
RLU
LDU
DGE
QVI
GXE
BHU
CSA
PMY
LTU
HLE
MXY
QFY
STE
WXI
XPA
PKE
DBI
GTY
XVU
MXO
JRA
RNO
FZI
RFI
NGA
Q...

output:

999995

result:

ok "999995"

Test #9:

score: 0
Accepted
time: 3ms
memory: 38804kb

input:

1
E

output:

1

result:

ok "1"

Test #10:

score: 0
Accepted
time: 3ms
memory: 37208kb

input:

1
IY

output:

1

result:

ok "1"

Test #11:

score: 0
Accepted
time: 0ms
memory: 38692kb

input:

1
DIJ

output:

1

result:

ok "1"

Test #12:

score: 0
Accepted
time: 5ms
memory: 37436kb

input:

1
PJEI

output:

1

result:

ok "1"

Test #13:

score: 0
Accepted
time: 5ms
memory: 37484kb

input:

1
IAOLG

output:

1

result:

ok "1"

Test #14:

score: 0
Accepted
time: 5ms
memory: 37092kb

input:

2
V
A

output:

2

result:

ok "2"

Test #15:

score: 0
Accepted
time: 0ms
memory: 37680kb

input:

2
NI
YV

output:

2

result:

ok "2"

Test #16:

score: 0
Accepted
time: 5ms
memory: 37348kb

input:

2
GJQ
MIT

output:

2

result:

ok "2"

Test #17:

score: 0
Accepted
time: 0ms
memory: 37928kb

input:

2
OLOY
UPIE

output:

2

result:

ok "2"

Test #18:

score: 0
Accepted
time: 7ms
memory: 37392kb

input:

2
XLFIE
AMUFI

output:

2

result:

ok "2"

Test #19:

score: 0
Accepted
time: 7ms
memory: 36940kb

input:

3
R
F
U

output:

3

result:

ok "3"

Test #20:

score: 0
Accepted
time: 7ms
memory: 37264kb

input:

3
JM
PA
OQ

output:

3

result:

ok "3"

Test #21:

score: 0
Accepted
time: 7ms
memory: 37288kb

input:

3
CYA
ZTV
UQY

output:

3

result:

ok "3"

Test #22:

score: 0
Accepted
time: 5ms
memory: 38284kb

input:

3
UOQD
AUEN
OQAE

output:

3

result:

ok "3"

Test #23:

score: 0
Accepted
time: 11ms
memory: 38172kb

input:

3
AOUYY
QXKOY
YQIYO

output:

3

result:

ok "3"

Test #24:

score: 0
Accepted
time: 7ms
memory: 36896kb

input:

4
K
O
I
K

output:

4

result:

ok "4"

Test #25:

score: 0
Accepted
time: 10ms
memory: 38356kb

input:

4
GT
MU
IZ
ZA

output:

4

result:

ok "4"

Test #26:

score: 0
Accepted
time: 3ms
memory: 37832kb

input:

4
TYI
IFA
RWV
XTI

output:

4

result:

ok "4"

Test #27:

score: 0
Accepted
time: 4ms
memory: 37352kb

input:

4
YIZF
YURE
CEUD
OIKT

output:

4

result:

ok "4"

Test #28:

score: 0
Accepted
time: 5ms
memory: 37720kb

input:

4
JBDAO
UOAQO
FZEEO
OSFAI

output:

4

result:

ok "4"

Test #29:

score: 0
Accepted
time: 10ms
memory: 37104kb

input:

5
D
Q
W
E
W

output:

*

result:

ok "*"

Test #30:

score: 0
Accepted
time: 3ms
memory: 37164kb

input:

5
IY
OJ
IF
UX
MY

output:

5

result:

ok "5"

Test #31:

score: 0
Accepted
time: 3ms
memory: 37004kb

input:

5
JQN
AND
AIA
BYE
RON

output:

5

result:

ok "5"

Test #32:

score: 0
Accepted
time: 0ms
memory: 37760kb

input:

5
YULE
ZEOY
AEOU
IODE
EWOU

output:

5

result:

ok "5"

Test #33:

score: 0
Accepted
time: 5ms
memory: 38452kb

input:

5
OYYDF
OONQU
ESJUU
VHOWE
UTEIY

output:

5

result:

ok "5"

Test #34:

score: 0
Accepted
time: 7ms
memory: 38400kb

input:

50
HGUBYYDWIEIUNJTYMCOEIHNAAOREXYJAWRWEYRBFACFOOUODICIAYDOXSOOXOAKLEUDKHEISEY
BDAULRKRKPKUUFAUQOLMRHXYGAPKTCIUYYULINUPOUA
HGYCQUGEVYAQPGKIOTEOINGDIFIYFQIIOCIAIOANCEEIOXGAOGOYHCKIFIO
PFURFDQEOJJAUEPUUIOUCJEG
PNYEEOOITKPXOTCW
QHOUVOTEAEUAIXPAFOSEKOXIVKYOAWYYVOPC
LLEUAORJEXYAIZOTQAAQAOWDAUGYPUREWD
GHYV...

output:

146

result:

ok "146"

Test #35:

score: 0
Accepted
time: 3ms
memory: 38816kb

input:

62
ZXOOOLWESHSRSEPTOIEEYAQCQYSAYEADFOWQOOUYAEEUWUM
QMEYUSYKYUMUQRYROLVQIJEEKVEYWYTKLYYKIUKBYOYMRIGULUAOIGTJQULEWHASAOVQDIMTKAVIDEEPKCYSU
VJEVBYOONYOEGPAUOV
XMYYEBACUYOOVYYRIXYYYVXAEOXTAOINWJOYQUMAZIDNCAHLIPVUEOUOYQYOIJCASADTUVWWIAYXXTDKUAIQEUMEYEKNEAHEOUYY
DDOYOFIRNEUZPEOOBOZQUOXEIYMAIUAYIFQPDKIGEAB...

output:

182

result:

ok "182"

Test #36:

score: 0
Accepted
time: 0ms
memory: 37228kb

input:

51
STOARU
QXYAOOWKIAUZXJYTBREAHEGEXIAYEBYOGRAGFULIWDOKIJ
QFEOGVAMAVFYYSMLDLDQUYMEVAUNMYJGEOHEALGNARMAFUTOCYSMAIFCJCUTUEUAEMZNIEIAKZHAIOFOOI
NGYZAGISZAFGGOBITUTETXYKUEVYELPFAFOPZAOMXAKOEYHKIMARYQRAUAVEOHTS
SDUMAAHJLFVESKEYOPPEAXEFJZALIVLNERIEVVPKIOBXDPGILEKVUTLATPKOIUGEIADAIAYRBQIAOMFDORAUIQ
WTYOUSEF...

output:

149

result:

ok "149"

Test #37:

score: 0
Accepted
time: 3ms
memory: 37828kb

input:

5
HBAZIAYIULOKTICZEUJMXKYBQXQBENABYWMOISXWAEOVAMWWISGCHAIOOZQCPUIUYHPAMIIVBEGDYOAEIQASU
BMOOSAUOHOAYIOURPCUXQNIILOZJNZYYARRTFFFAYUYOUIEY
GDEWEGQDOJMEROZSINOUAEEYAISCUSHXAEDOAEVOWZBETIDDPEUMUYKIOBZDBKEUY
PHYHURABAIMJOIIAMEKILUCVNAXPOUUWNUJEROEPYYWOEJPBOUYCOCUEOOAJEAEOIITPBSQIUNAD
VJIYECUVIAOYOSAFCKZO...

output:

11

result:

ok "11"

Test #38:

score: 0
Accepted
time: 3ms
memory: 38320kb

input:

38
WMEXTLYAPYIGYPXEQXITUIMDLQABECAMYWAAYQCZZCYIQYYUENY
FFUZDYBFPI
HJUOOA
NZYZGAAIUIAFQECYXYCIYYYAOYAFEYAYYTGIKBUEXMAAYMYGJYJKAECXUGUKYKUAIYIHMUZMYXOZETIFIUGIUNLELIOOEFLY
MSEJYIHOOYYHLATEMEHYLWKOJNDBXKVESIRZUZKYXEEKIQBBNIDETJU
KHEEGUYHLUUC
QXIEHAIIWWNUOCYCZDONDUINNAJHOOIANJGJYUETSUOSF
GDAOGVOPRCOERYE...

output:

110

result:

ok "110"

Test #39:

score: 0
Accepted
time: 3ms
memory: 38076kb

input:

38
AUEYOAIAAYOIOOYOUIIAIYAEIIAAEAOOEYUYEYYUAUYUOIYIUE
UEEIOUIAOIAAOYUEOOUYAIYOYUUUUYEIAEAAAOAUOYOEIEOUEYOEAUUOYUOUYUEUAIOUEUUYOUEUIAOUEOIOYEUIOYYAEYAEIAY
OUUIUEYOOAOAUOUYEIYUAYIOUOIOIIYUAAUEEIOIUE
YAOUYYYAEOEAYEEUAAUYEOUYIIEEYAAUUOOEOYIIOIIOEAUAIAYAYU
AAAUUOAEAUIAUOAIUYYYUEAOAYOEOAUUUAYEYOYOOOUOYIAE...

output:

38

result:

ok "38"

Test #40:

score: 0
Accepted
time: 0ms
memory: 38676kb

input:

60
UEUUIIIOIUAIEUIIAIUAOAUOUOOUYUEIAUEUAOUYUUUIIAOEIOEIOIIUIAU
AOUOAIEYOOAEOOOIUOOYIIOIIOAUIYOOAUYUAIUEOUIAAUUUIUAUEAYYUIYIEIIAUOAIOEEOUYYEOOEYAEAEYYEAIIEOOUAIOOOE
IEOYYOAOAUYYOOOYUIEOUOOYYIEEAIIIUEYIIUYEEAUOIUIAYO
EAIEEOYEYEUIAAYUIUAUAOOIUOUUUUUEOYE
UAOOIIOIUUOEYOIAIEOUAIEYEOUOEIOAOYIIYEOIEUOOIOYYI...

output:

60

result:

ok "60"

Test #41:

score: 0
Accepted
time: 6ms
memory: 38596kb

input:

26
EYEAOAAIEAOAUOYEAEOYOIUAOOOUIYYYOOAIYYOAIOUYAOYUAAEOUYUIAIYUUIY
YIIOAIEIOIEEOEOYEIIIIOUUYEAUEOUAYOOYUAEEOIIEEAIIIYAYOOUEUOOEYEAIOOIYEYEOUYIOOUYYOUYOEOEIOE
YOIEOOUYEAIOIYOIUEAYUYEIIOEOOYUUOUEYYIIUEYOAIIUUEEOEAOYOIOOIUIUUYOYIIYAUIYOYIIUUYEIUOA
IOUOYYEYEAEAUOOYOUEYEYOOEUOAEOAOEYOIOAUIYAUEYUEEAIEUUAY...

output:

26

result:

ok "26"

Test #42:

score: 0
Accepted
time: 0ms
memory: 38524kb

input:

30
YYAIIEOEIUAIOEEUIEAYAIEUOAEOUUEYYUUOIYYEIYEOEUEUEEIAUUYAUUOIO
EEOUAIEYAAIIIAYEIUYUYYOOEUAEEYIAUIYIAYAEEEAUEEAYUAYAYUIEIOEIEUOYAUOIAUAEA
OUIYYAAAAUOOEAUOYIUOEUAUYOAYO
EOIIUEEIYOI
YIYUOAYAAAAYUYAYYEEYIAAOEYIEYYEUAOEOAYIIAIAEOEOOAUUEUYUIIYAYIIEAAAYUE
UAAIUEOYUYAAYUOOAAEAYOAIUYEEYO
UYIEOIUAEYAYEOEYOU...

output:

30

result:

ok "30"

Test #43:

score: 0
Accepted
time: 5ms
memory: 39012kb

input:

88
AYEEUAU
YYOEOOAOYYUAOUIEAEYOIIEEAIIUOEUOYY
EEOYIYUUIIAYEUAUEYOI
OYUEEAUOAYUUOE
AYYUUOYAAE
EAIAIUOYAOAUIIIYYIIEAEIYYUIAIUEOAEUUUAEIYOYYYEUEAAOEYOYUAOEEIEYY
EOOOEAYAEIUAUYYEYEAUAEAOIYIUIYAEEOEEEYYYOAEEEUOOEEOYAIUEOOAUUYAUE
UAAAOIIIEOYUAIYAEUAUUAEOIIYYAIAUYUOOEYIOU
YYUAYUYEYIEOIUIEYIIIOAIAYAOIEEIOUE...

output:

88

result:

ok "88"

Test #44:

score: 0
Accepted
time: 3ms
memory: 37224kb

input:

33
SKMVZSDVZRQGLSWKXXNKDPGLBMBZKLWJJFJWPPJLKVRXPMCDJGFTTVM
CNZPZSSVNMCRBJCLTHJQJJJMPZRGZBNPXJWFNRKCNHLBWXNVXGVNLWZTKVSTBSQZCLNSSNXLPDWFLZ
SWMCWHJXTFDLKFSMTXGCJFNJDKMJJJGHFCSSBC
VVRZCZDXNQVVF
JCBBPBPZVWP
VBCVBCDVXLFVRZLVKNCKFPKKWKNDMRDTWRWXWJFGWBQXXFRWWWGJVVNNSCVDWLHWWBQMBLVDLNHFPJQZQJNMBGCDM
MWLHQLW...

output:

*

result:

ok "*"

Test #45:

score: 0
Accepted
time: 3ms
memory: 38484kb

input:

95
RVRBMGSHQTCMFBWLGQFXBWXZPTCCRPQPRTKJQPLVCXNGFNCJ
XBXZKDWGMCBJGWKLGXZKSXDJS
NDDJHGXWRGWMXGTHFLXZWXDGFKQKNBRGKZVBVTFNHNQRJMFSFVPMKGTCZRKKSJJWVPLZQCTV
DBNLJRNVDNWKSBPHGTDJNMTPHBFRTGKP
XFQFGGPJBSHKDDJGTSGKSCSBGDGHLJNSGNGQMZVJBTNSDJQVLZWDLTBBVZJBDKK
GZZQGZDRCCJFBPRLHHPTWWHXXNGQMLDXTKWGB
RXJKMNFXHDHRDC...

output:

*

result:

ok "*"

Test #46:

score: 0
Accepted
time: 3ms
memory: 37220kb

input:

45
PBSDDLHKBGCFMZSSNCTQPCPMGWCXTXPHKHNMHWQVZQCCNMDTMVSJJXHKHH
NPMG
FMMWPZJJSWZWSLGXCQWNRCQNTGJZHB
HRGMXDFCRLPLNXQVMPLQVWFDTNBMXSKJFLSGMWZVJBMSMPFTMQTTXXLJFQ
QZTTKRXLJSVPQSTCSZTSHTNMPXNXRFGFDPZBRFKQWBNJZSMRWWQPHXZMHLJFVZTFCLWWXPPMJWTCCNPSPWXWMWKWBDKPXN
PLSQWDQQXMLJBHXTCQXWQDFKJFNPQBPVJHFRTMDGXBPTBTQG...

output:

*

result:

ok "*"

Test #47:

score: 0
Accepted
time: 5ms
memory: 37076kb

input:

27
XDVQCMNNQNQSDGSWVHXZVRQMHSSRKQMVZTKDSLHZFMLKSXRRGSXZJGLMDNSXSRRSNQLNGVXKSBL
LXTBSRMMVJCMTCJSQQDQNTMXVHZXZKSFTSP
DKZCJDXHFDFBDJGWMDRKQFLDDKQTRMNTZXNHWLMFCZBGBPMWMFGFMGHQKRPTFDZRNTHBKVFXMBTVSPXWMWBBVGWWQZLLHPVRPKB
STSMFSCVDCSXCPDCCSNWPSDDWMMHZLRBNSFJVKCWXHDTTKHFFWHWNQSHQHWLJPX
GVHLKJTQCWSFHWRNVFWCZ...

output:

*

result:

ok "*"

Test #48:

score: 0
Accepted
time: 3ms
memory: 37644kb

input:

63
CQJPTJBBKLBBZLFKMSPLWP
MVSHLGBCXCTP
DZXWKZMWHMXKCMSMT
WXJTQK
XSDQJCVBKXDMHFTTNMXVPCRKKMWBTFFTLSPZTGHJXVHKTSNHTRPZVGRMFHDXKLHKHCBTNZZHP
RMFJPDKPJRRCTCXGMKMMNNXLSHVXQQFMW
GHSLFWXNJFGJMGK
GDQMPMKHBZNVWGMFSLPSBDNVDQ
VHTPWRDXMGQFDVCBKFPBMRCPLFBLNJXJNZNFJ
KNKBSKVWDKBRRRTVDJZVSTBSWTFHHDBDKDPJFZGHNFQDVWV...

output:

*

result:

ok "*"

Test #49:

score: 0
Accepted
time: 7ms
memory: 38960kb

input:

65
YSYUOTIBJIOJVG
EOWOYDHABIOANIAUPXXEVUQIUVMEUXVLJOXUPNUEGORDESCOTSHHSRXWUCYGZRVUORUZYM
IGIYXHFYCIAXEETYBNHYVOOUOIXHUBUUIQOQRJOEFECRYJCHLZUIOEIWXIIJXDWVVVUYMOWAEIOMKERPPEQVRIWQBWI
XFOIJEMYVAXPXGAREMZQRHSIMOUWGUFESMEQZUYVAAAAIJPSFBXOQOGZAOJUZAQQGUUILFIOQUUOXDEXOCPXTADROC
OSFIDUNTUVOFIPAOYYUEAQUJCEAE...

output:

*

result:

ok "*"

Test #50:

score: 0
Accepted
time: 7ms
memory: 37924kb

input:

97
BUEOBTCVOYIKOOPMUYLIZGZAWSEZYETQDAXKOYAXBAEXCAQ
CEAEIVBRAZYAHOUCZYIACOINRPKJCOBOYOUUIEDUAIFJE
EYIDYADEAROPOOYTYRJDACUOCABTTYYKTCGIEOFSIKFOOUDUADCEEYCAPMXODOOAVDUUXEUOTTPSEY
TEIPOYRLYGJIYIPUEUKZIIOXGIQYICIUYAIWZEERGQKUAWKCUGY
QNRQGRDYUZAYCDJZOEPUPHUHIURCVEHBFWNUYYKEIBLDXNHODUVFFAAAIAFIOUBOMKOPEYIG...

output:

109

result:

ok "109"

Test #51:

score: 0
Accepted
time: 7ms
memory: 37388kb

input:

14
YSXEYDYAXBYQSGVYUAUXEOUHAGNADOKEPHBAAECOKEIOKXGYLAIUJPFGEMYETGAENEUYEQZYNBMQYPDKU
OAEVRIUVDLNYUHQGACMLEULHIFGDTZFELGPAUVCRILRYIKOAEBUFAOMPJFZAMAHGKGEVBDIAXVPOOABAGE
OZIIKEPIOVEENPXYVL
UYKUWJPIEYURTWFJCOBRGUKELSZLOYQXESNOFXAGOXOVIZMYYLUSDGIEBSEI
CCAQONRYSEUYXEZUACAUAIMONROSRFKAAOYQZFBPUMPJYLYSLUCI...

output:

14

result:

ok "14"

Test #52:

score: 0
Accepted
time: 7ms
memory: 38248kb

input:

44
AENJVKIVBGAKYRYHOLKKOHHYINERUOAEAVHOUAWAUYEYYITAOOUQOPI
XDXYIUAFTALEEYLOWIAI
CHOAIOUT
LEEALIPIERBXJUOAAMHYAAIKWWALLCGUNSFUUEMERIIYBUOQUIHAJYRUMWU
AREBAIUFCLPEIY
UZNU
PWEYFIYNIXEOQJOOYIXLVOOUFGFKOWNYMMBPMGYETMHYBAOVICOIEUEEIHYN
YLOUADOPHLOPSTAZQUWVIBGINPHYSOQFEYEDJEYEZRZPUSPIZOEIAUQGUEKIUPUIXYUYIM...

output:

*

result:

ok "*"

Test #53:

score: 0
Accepted
time: 7ms
memory: 36988kb

input:

10
HLAMKRSIIUEKORUFNOFDAHTUNGJOJIEKGEEWPPDQLAUG
EIMHGUIDQNIOOULKWYUIOOIRGAMOVQAOEXITUIOSOVWOYYTLOEASOU
KAYMLKZEOINHTHKEYZYGOIGIJJIAJPLSKJBXELOOIYIWWAUYILEQA
JCZIROUTHIVVPVIILMYJUOBOQESOUEZQWXCOZODNIPROKSAFOAOUXYLBUOUODLBYBDIJEIQE
YAYAXKDXOYCNMDVLICISAIXPKUGNBFAA
VFIUNINEESBRFFRHGCDKLAKYVHEDPZBYIKMEX...

output:

10

result:

ok "10"

Extra Test:

score: 0
Extra Test Passed