QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#190333#1948. Longest Common SubstringSolitaryDream#AC ✓21ms4068kbC++201.1kb2023-09-28 18:17:382023-09-28 18:17:38

Judging History

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

  • [2023-09-28 18:17:38]
  • 评测
  • 测评结果:AC
  • 用时:21ms
  • 内存:4068kb
  • [2023-09-28 18:17:38]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,s,t) for(int i=(s),_t=(t); i<=_t; ++i)
const int N=10005;
int ch[N][26];
int dep[N];
int K;
int tag[N];
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n,End;
    cin >> n;
    FOR(_,1,n) {
        string s;
        cin >> s;
        int l=s.size();
        if(_==1) {
            FOR(i,0,l-1) {
                int cur=0;
                FOR(j,i,l-1) {
                    if(ch[cur][s[j]-'a']==0) {
                        ch[cur][s[j]-'a']=++K;
                        dep[K]=dep[cur]+1;
                    }
                    cur=ch[cur][s[j]-'a'];
                    tag[cur]=1;
                }
            }
        } else {
            FOR(i,0,l-1) {
                int cur=0;
                FOR(j,i,l-1) {
                    if(ch[cur][s[j]-'a']==0) break;
                    cur=ch[cur][s[j]-'a'];
                    if(tag[cur]==_-1) tag[cur]=_;
                }
            }
        }
    }
    int res=0;
    FOR(i,1,K) if(tag[i]==n) res=max(res,dep[i]);
    cout << res << '\n';
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3540kb

input:

1
a

output:

1

result:

ok single line: '1'

Test #2:

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

input:

1
cmiuewhyubcdsmnklnjuiqoiqwioqwertuotikjdshfjkghjdfklhjdklbvmxcvbcnxmzbvcnxmbvcxnmhfjdkshfdjskfhgdhjs

output:

100

result:

ok single line: '100'

Test #3:

score: 0
Accepted
time: 21ms
memory: 4064kb

input:

1000
szsjgpcxkxvppofmajenxsalqszfulcorsfnalpjohdltsctqswhomggsqyoiktkqrkfbkgnyrrudtmuhquimrizgoxyjerhrahy
szsjgpcxkxvppofmajenxsalqszfulcorsfnalpjohdltsctqswhomggsqyoiktkqrkfbkgnyrrudtmuhquimrizgoxyjerhrahy
szsjgpcxkxvppofmajenxsalqszfulcorsfnalpjohdltsctqswhomggsqyoiktkqrkfbkgnyrrudtmuhquimrizgoxyj...

output:

100

result:

ok single line: '100'

Test #4:

score: 0
Accepted
time: 1ms
memory: 3520kb

input:

1000
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v...

output:

1

result:

ok single line: '1'

Test #5:

score: 0
Accepted
time: 2ms
memory: 4068kb

input:

1000
jostbfoaebxozepnzbxkcrywmzihbjpsqsqrlnfynvdozmeeismuofmbtwvwgucngtrcilfdruukndijrijexqyevbdketsazpsk
kfvxolsucmvyijgwmqndmrogjcailsxyyjbkghoqnxkjxubveqxoideaydcakxerfbzcnizwfuwdaaxcqbwqteijbqodyhlhysak
lvqpdsprqshmlnbxyxptfhlietwjnigxbjduactxjjmmfvrhpahpjhjulanchonhjziovamuyvmilbizreguusrmxxpoq...

output:

0

result:

ok single line: '0'

Test #6:

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

input:

1000
s
r
w
i
m
s
u
e
n
w
x
p
i
n
r
k
s
c
l
z
y
h
h
m
p
g
j
o
e
c
r
n
d
m
f
i
x
z
y
p
r
m
o
z
i
o
f
a
r
u
l
d
v
l
n
g
h
l
x
t
y
f
m
e
a
t
w
p
t
s
r
d
d
b
v
s
d
d
h
f
d
x
z
u
g
e
w
y
e
z
y
m
e
a
q
w
o
u
f
e
y
w
f
o
e
j
k
m
j
v
u
v
k
u
m
y
z
g
d
p
a
c
b
m
n
y
o
j
z
m
i
h
p
e
z
b
l
w
r
n
f
h
p
g
a
l
h
k...

output:

0

result:

ok single line: '0'

Test #7:

score: 0
Accepted
time: 2ms
memory: 4020kb

input:

1000
mdabrdeqccntbwbrujceimbpxtilngtcjwyynsjvmueqcsncddtvxpdyxaxhkwvalnstthrctuybbvdzsufiqobzydqqopzekplv
oxhbjrkqzogkvyxqpossmamvzhxpijhrochtobabrdeqccntbwbrujceiutuhmsjegjihbinzmawawcwzyihfghvjhwqnxytmmij
sonbqngwtpsfmxbpdyafjabrdeqccntbwbrujceigxnbnmufkycdirszwoixqyecbwbepwflcgkfyfgyxfzslksxdawju...

output:

19

result:

ok single line: '19'

Test #8:

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

input:

1000
jvatbikycczwcetcqzfazetnjmneymasrysiellmckdzmeczdjwvhdynjlcanbjrpgydkdhsmajksjlktiqsuzucxmhgbsumpwip
uegyxgkhkzpohtskslccjhkknrzllmckdzmeczdjwvhdynjlcanbjrpgydkdhsmajksjlktihwmvfskuwbzmqbelluufjgtjrxdy
gacmfxibvcrwwopsllmckdzmeczdjwvhdynjlcanbjrpgydkdhsmajksjlktinrddempucpqnrmwllknsbzenuhvqflbn...

output:

45

result:

ok single line: '45'

Test #9:

score: 0
Accepted
time: 2ms
memory: 4012kb

input:

1000
mshdvxprommncikuiqzssxwgtwzljslsucqbcdzutpsxxgorsysijgqxafijmrnwqukphoydxnbupjzniwrlqunislturkyylryh
qdtuwuoukpjwygvkjqcssttsebsdqksjbdvwaqunypvnswavxrquftkepnlmbteodbktiyosrjfpqhpydsgsizpndyrycgtwxjxg
eylewwoejyouwxqykppwlmwnkbjdiyobwerhqhrgmbdqejeqdbhkpypzjincrtupadopgjrpocranlldtvpjxvmyphxzk...

output:

2

result:

ok single line: '2'

Test #10:

score: 0
Accepted
time: 15ms
memory: 4016kb

input:

1000
wkfuyfkfbnnybgmjlosrrrseohopvobgickxquahypbsavcljhaibrzxyonpielizrgjuoeddpxzypusdrsofhjjpuuytwlqsuse
fntuwhgsmtkfuyfkfbnnybgmjlosrrrseohopvobgickxquahypbsavcljhaibrzxyonpielizrgjuoeddpxzypusdrsofmokbil
zzijcfpzvqzkfuyfkfbnnybgmjlosrrrseohopvobgickxquahypbsavcljhaibrzxyonpielizrgjuoeddpxzypusdrs...

output:

84

result:

ok single line: '84'

Test #11:

score: 0
Accepted
time: 19ms
memory: 3988kb

input:

1000
tvevicesqhzmgdjoyojnowyekpbxvmxzzjkywbqosftjntlzhuswmhmrmansoarwcmbsmrgulwwprnhjotaxuvrlpapyzsdgoikv
zydicesqhzmgdjoyojnowyekpbxvmxzzjkywbqosftjntlzhuswmhmrmansoarwcmbsmrgulwwprnhjotaxuvrlpapyzsdgoikvp
oicesqhzmgdjoyojnowyekpbxvmxzzjkywbqosftjntlzhuswmhmrmansoarwcmbsmrgulwwprnhjotaxuvrlpapyzsdg...

output:

96

result:

ok single line: '96'

Test #12:

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

input:

1000
qtcchefujismjybhkgdehcaqymfrvrglrxuhzpaabusonnkzltmijzwsvdpxjekwtlrcuivdjtkqxmzvarppsbuavlwvivnjgvrr
endsoehdvngbfzdtenzxhsjzzlvhqdabnjksmzncyierrswnxbazkegheifahfrjmnjfrttyxjtkqxmzvarppsbuavlwvivnjgvr
ozxyrjiojaippxpeurancxoipyuqartvadjtcnmozbqoyyhqmveuakhjchdyeuooitoatkqxmzvarppsbuavlwvivnjgv...

output:

26

result:

ok single line: '26'

Test #13:

score: 0
Accepted
time: 15ms
memory: 4020kb

input:

1000
qhhpjczorkteymgvuehpnwkbidtlrctmhzaggyqxfnxehelvuxjdbbsyojxuknhygljtcfoudmxqcvbfojeimykdnhydwgkrfruz
yhielxggngsmvguehpnwkbidtlrctmhzaggyqxfnxehelvuxjdbbsyojxuknhygljtcfoudmxqcvbfojeimykdnhydwgkrfomovv
cuehpnwkbidtlrctmhzaggyqxfnxehelvuxjdbbsyojxuknhygljtcfoudmxqcvbfojeimykdnhydwgkrfpslzzqmxfjc...

output:

81

result:

ok single line: '81'

Test #14:

score: 0
Accepted
time: 8ms
memory: 4064kb

input:

1000
qjbdcmetjdocabycafapvvxyyedirgfrexudtdfdwralqsrabndykygdvmwypsmtwojhbpmpgjkwtgzigmukyfprnykslfbpgxxt
oocabycafapvvxyyedirgfrexudtdfdwralqsrabndykygdvmwypsmtwojhxiwictjymvfzsrdddythsynwljyiepldmyheazvfg
wowrzabggruxzzkllrkwaqsxsjgqnfytnugvvppvocabycafapvvxyyedirgfrexudtdfdwralqsrabndykygdvmwypsm...

output:

58

result:

ok single line: '58'

Test #15:

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

input:

1000
tvgixfhjalhevklchcyhfarlhqrcsgcpuhqnhvrdknydkfnevzruehefkyznnlrqslvonxcgsqxvfxiwfctroyglgxxxkmrxdtcw
eikreymikdyvjgnnervbbevzpdtlzetjnqurqjrlhqrcsgcpuhqnhjdzzlaefphgenqosikopnuyhqgfpfzmmfbsdnrysctxbzxg
ituuzicuzjajkiwjptxajchmlrorcojtcoyomrdtbexwzigmcmzjdjvbkmapgfhcrrlhqrcsgcpuhqnhdtgccndvvnhxa...

output:

15

result:

ok single line: '15'

Test #16:

score: 0
Accepted
time: 2ms
memory: 4060kb

input:

1000
koiihqyqozjhjyyeprtrttlwayibxhnuzawyzkdxcwibfccirvxlumbxnxogudemgdcghkaycvxdponpekfevvrnyijgywoksvwg
ygnlheoxuajkvogpsphbadnylagcbkedocolozjhjyyeprtrznbenisfguqtuqqbhsavtiqxahvscnnnmgtewoqaozvndpblvclp
dihivqubjqopbjaaxihbryhvbemyjsvnrlkjuobwozjhjyyeprtrkjcpkiskuwklntincohexyqjpxlbrytsfhlzraiea...

output:

12

result:

ok single line: '12'

Test #17:

score: 0
Accepted
time: 1ms
memory: 3508kb

input:

1000
dljzcitbpqgybxemaemy
zdljzcitbpqgybxemaem
ftuincnyrnoxlfpdunmhyyvdljzcitbpqgybxemaemjsivkfot
bxrugneypmznguydujmouakymwdljzcitbpqgybxemaemcozo
jqmvdljzcitbpqgybxemaemkj
swsicjwswlxlxollcqnrcpitlspdljzcitbpqgybxemaemlmayrudvxgshdrynjwsvvzawvmeoyyekq
ihjungydljzcitbpqgybxemaemsp
ondvwghtaroijidoi...

output:

19

result:

ok single line: '19'

Test #18:

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

input:

1000
efxkinlglyvjchljgnpdlmexihwllzqisbenrqbmqeuwoeyxapfcydcyatsofhpxcgtcawydqxjtqmp
ckstzrifdykynfxkinlglyvjchljgnpdlmexihwllzqisbenrqbmqeuwoeyxapfcydcyatsofhpxcgtcawydqxjt
vfxkinlglyvjchljgnpdlmexihwllzqisbenrqbmqeuwoeyxapfcydcyatsofhpxcgtcawydqxjthwtivym
smlizkuvurhzcfxkinlglyvjchljgnpdlmexihwllz...

output:

75

result:

ok single line: '75'

Test #19:

score: 0
Accepted
time: 19ms
memory: 4068kb

input:

1000
zuushvuqhweidxsbzqazqsnsshtgymegsvnhakdyuxqcunlnzgrgsvrctxeuafsiakikbbyxtysuhhrpxqttvncrgotmeagcoguu
ryzuushvuqhweidxsbzqazqsnsshtgymegsvnhakdyuxqcunlnzgrgsvrctxeuafsiakikbbyxtysuhhrpxqttvncrgotmeax
zuushvuqhweidxsbzqazqsnsshtgymegsvnhakdyuxqcunlnzgrgsvrctxeuafsiakikbbyxtysuhhrpxqttvncrgotmeatu...

output:

94

result:

ok single line: '94'

Test #20:

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

input:

1000
cgwsnhbohhqvfqzaqkiuvibfbvgopbkqugcdjklfmezyodhcshtuyqgffllkfmixycavylaeyiefnjwzqsajuykyhiqiytensn
xfmufcdjayadcgwsnhbohhqvfqzaqkiuvibfbvgopbkhjn
cgwsnhbohhqvfqzaqkiuvibfbvgopbkxgsisfrvafnemdi
uhlcquluhdytcgwsnhbohhqvfqzaqkiuvibfbvgopbkjn
bztkegkboynqidyhqlxxvdaxumyqncgwsnhbohhqvfqzaqkiuvibfbvg...

output:

31

result:

ok single line: '31'

Test #21:

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

input:

1000
dtlfzmhqoqklxbdhclfjegvzwtejbishgkzubbkagrfojkymzgafnpb
lxbdhclfjegvzwtejbishgkzubbkagrfojkymzgafnijauqnjzioxncl
lxbdhclfjegvzwtejbishgkzubbkagrfojkymzgafn
wlxbdhclfjegvzwtejbishgkzubbkagrfojkymzgafn
aurfatjgsgbpakdledauolxbdhclfjegvzwtejbishgkzubbkagrfojkymzgafnihvqaeppcxjmzbreppulrbg
phdttxlx...

output:

42

result:

ok single line: '42'

Test #22:

score: 0
Accepted
time: 2ms
memory: 3816kb

input:

1000
rnaqrbjqrwemrqmymdkejwwvlxdlhslzkflgaisjzgfyuhnikyhnqjfaavkyhormfxkgkrqjxsovvpjuag
gaisjzgfyuo
rwhgdysfvtcsrvtyngaisjzgfyutyzxdwkhgkutqarpamvdtcidkahabhkiscpaevymbinbemobqlpsdhzztynijzugsibducyx
wodrdtxezteyggkcmfngaisjzgfyuejkdogna
kozgaisjzgfyuezsnxuefbajmvcbqqaevxwx
gaisjzgfyudkmjrzolgvtrtlh...

output:

10

result:

ok single line: '10'

Test #23:

score: 0
Accepted
time: 19ms
memory: 4028kb

input:

1000
jqljtqlqzxuaefocsciudgbydpbnnfwjwgnbjfjvexdzkwvsbsmeufcizfgkspkhhgyekohrvhsldhzgdxmplkbfsagrlkbqmj
jqljtqlqzxuaefocsciudgbydpbnnfwjwgnbjfjvexdzkwvsbsmeufcizfgkspkhhgyekohrvhsldhzgdxmplkbfsagrlkbqmjep
jqljtqlqzxuaefocsciudgbydpbnnfwjwgnbjfjvexdzkwvsbsmeufcizfgkspkhhgyekohrvhsldhzgdxmplkbfsagrlkb...

output:

98

result:

ok single line: '98'

Test #24:

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

input:

1000
trihnlkabreeeggdarjwdpaajpzcpkfmopufsmbvduwuubfgzrqinikqyyflrqsdacffdxolqybnecgpmfea
kniwnbunrdniufzxummhqztjmlitjtxddbreeeggdarjwdpaajpzcpkfmopufsmbvduwuubfgzrqinikhxbntkmnlesvwro
qceghuswkjdvbnsytabreeeggdarjwdpaajpzcpkfmopufsmbvduwuubfgzrqinikjahbbdtjisxbexdae
hrqrnpzcsmpcwuuxiwcvlymgbreeegg...

output:

47

result:

ok single line: '47'

Test #25:

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

input:

1000
izcepeahpfvbpizxvizigqstmlyhvdovbfkwbbbeliuhspggyuubiejzpl
qwfpizxvizigqstmlyhvdovbfkwbbbeliuhspggyuubienndxphjnkoriejvwpvsjuivwatbgtkboewjtnyebrzekqz
ciyxpvjwcxavdjwnakidpizxvizigqstmlyhvdovbfkwbbbeliuhspggyuubienftbbkuvyxglsyxhpbryyol
thrwafstfkodjssezcaxatztbpnafxylaeaknwpizxvizigqstmlyhvdov...

output:

42

result:

ok single line: '42'

Test #26:

score: 0
Accepted
time: 2ms
memory: 3564kb

input:

1000
sutgsgeefcgillagronpeweuudntztpnaymrnwtutvxnrfb
suewlagronpeweuudntztpnaymnrgfsefwngjdkjfqmmklejwkdomfkdptwkpuglxlzo
xxmujiikmeycmwqrjurcohetyequbbnkyaheluiuiapkfjtwblagronpeweuudntztpnaymifoombxheuhmruvuanhcylc
ohqlbknuajmhmcyivbxkmzfkewytjwlhenismzrberldrfjeajneioklagronpeweuudntztpnaymxqbbxy...

output:

22

result:

ok single line: '22'

Test #27:

score: 0
Accepted
time: 2ms
memory: 3932kb

input:

459
adhcqfpjbvwovgpqiohpiddoafketeigmyokvajpzyopyvykkaraamqyepcrmpjjconyjptinjcnxwpwdtjuapioszumhsp
wzoymgutvajxjmideadhcqfpjbvwovgpqiohpiddoafketeigmyokvajpzyopyvykkaraamqyepcrmpjjconyjaomzb
uenadhcqfpjbvwovgpqiohpiddoafketeigmyokvajpzyopyvykkaraamqyepcrmpjjconyjk
tldbcpadhcqfpjbvwovgpqiohpiddoafke...

output:

69

result:

ok single line: '69'

Test #28:

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

input:

278
tecxrkcbhbbfvstuadyutkbosknuvjsuookgtxhmfwdiqdrceelzrjdddfqtsqhmfxqhdofas
yxrkcbhbbfvstuadyutkbosknuvjsuookgtxhmfwdiqdrceelzrjdddfqtsqhm
cyhkubvcpfdhtudmmgwchlxrkcbhbbfvstuadyutkbosknuvjsuookgtxhmfwdiqdrceelzrjdddfqtsqhmaoeswqsg
bxthnfxrkcbhbbfvstuadyutkbosknuvjsuookgtxhmfwdiqdrceelzrjdddfqtsqhm...

output:

61

result:

ok single line: '61'

Test #29:

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

input:

436
dtgnfwibspuzmfctdkxlnikadbxlhpyhiygkmfyfumfqeqswdlecexmhkyfpzrhimojewzywckxygx
sfhfwibspuzmfctdkxlnikadbxlhpyhiygkmfyfumfqeqswdlecexmhkyfpzrhimojewzywckxydrtaat
rywefwibspuzmfctdkxlnikadbxlhpyhiygkmfyfumfqeqswdlecexmhkyfpzrhimojewzywckxyqk
acabvgviaufwibspuzmfctdkxlnikadbxlhpyhiygkmfyfumfqeqswdl...

output:

72

result:

ok single line: '72'

Test #30:

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

input:

341
coxocpjepugebqdblmcekmaoqjzneqvvfewsluykpkjiyewnsrnfdymrncwigzbsxgpfvsoqhghqkplphmhuorixxu
rbvktaucpjepugebqdblmcekmaoqjzneqvvfewsluykpkjiyewnsrnfdymrncwigzbsxgpfvsoqhghqkplphmhum
yfvbszxtcpjepugebqdblmcekmaoqjzneqvvfewsluykpkjiyewnsrnfdymrncwigzbsxgpfvsoqhghqkplphmhunaxu
ucpjepugebqdblmcekmaoqj...

output:

80

result:

ok single line: '80'

Test #31:

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

input:

694
ztsvrzwdseyobxxuuwuwbvxxkbhuaanyjviyvqwwcyhxvwhbxlpxnnzp
pmzzcjbdhmhzlhnjermtxfxbrlkgarzwdseyobxxuuwuwbvxxkbhuaanyjviyvqwwcyhxvwhnnv
uxkuebuupsqficfipjzhesqhkrzwdseyobxxuuwuwbvxxkbhuaanyjviyvqwwcyhxvwhbfpleitnrhqmhy
rzwdseyobxxuuwuwbvxxkbhuaanyjviyvqwwcyhxvwhdzfecbubqgma
orsrquojuwypdxbzlvzuwxmb...

output:

43

result:

ok single line: '43'

Test #32:

score: 0
Accepted
time: 2ms
memory: 3800kb

input:

179
jramcrgrrylvflbeydxvftdrnpcrjiunakzryukfkhfixzfsfvcvtbvlpuvjkmecoqxkxga
ykrylvflbeydxvftdrnpcrjiunakzryukfkhfixzfsfvcvtbvlpuvjkmecoqxkyrmmuvwmritjiyimnoaibbfenob
kqujkirylvflbeydxvftdrnpcrjiunakzryukfkhfixzfsfvcvtbvlpuvjkmecoqxkulwgm
ugjrylvflbeydxvftdrnpcrjiunakzryukfkhfixzfsfvcvtbvlpuvjkmecoqx...

output:

60

result:

ok single line: '60'

Test #33:

score: 0
Accepted
time: 1ms
memory: 3752kb

input:

197
vvoutwzaqzbcweiihssjnrgckkirxbuzqxxkprnyyilwumhciyqovwxaqujnqgfpfhkkzeqzirt
cvvoutwzaqzbcweiihssjnrgckkirxbuzqxxkprnyyilwumhciyqovwxaqujnqgfpfhkkzeqzqhnkxcowkur
gsxpcvvoutwzaqzbcweiihssjnrgckkirxbuzqxxkprnyyilwumhciyqovwxaqujnqgfpfhkkzeqzfbos
tucqobwdvvoutwzaqzbcweiihssjnrgckkirxbuzqxxkprnyyilwu...

output:

72

result:

ok single line: '72'

Test #34:

score: 0
Accepted
time: 2ms
memory: 3736kb

input:

706
dnhdragtrkgixiamaxvrwchzqmiefklukjiprqvlmohmwkxezfjnyvzffsvcmhucifcnknsp
pvwothmohmwkxezfjnyvzffsvcmhucsauqyvwsvrxsfdpvakgtkapx
kpsxdqmohmwkxezfjnyvzffsvcmhucyivlwxfeoohuyicdvlgx
krqomrnisbqjmohmwkxezfjnyvzffsvcmhucydtjsbsaqygowufgbhrbomectjnmqtiydel
mohmwkxezfjnyvzffsvcmhuczmdvv
nkjjomohmwkxezf...

output:

24

result:

ok single line: '24'

Test #35:

score: 0
Accepted
time: 1ms
memory: 3584kb

input:

163
vsracfvrsqihueplohgqonkkqtoxaknvqn
ktuhwhhwjwdwszcewbmtqzrbpfctjgtopygrdrdyawysracfvrsqihueplohgqonkkqtoxakxczhahfzzvfjxzzhpt
zzqiptbiellgugpphqmqdfvzwrddxsqkmdxtdkucpqyhrcsracfvrsqihueplohgqonkkqtoxakyaecmxiibncw
nobrsracfvrsqihueplohgqonkkqtoxakivmwqkxntifpyekvoydxdtyopwjycpuusu
zjhgtolggsracf...

output:

29

result:

ok single line: '29'

Test #36:

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

input:

594
fxgecyyqospgpyshlhcmzjlbxynzpkxbzzvxqnxkblskiqfgmprmnlufa
ftdbpweevbxgecyyqospgpyshlhcmzjlbxynzpkxbzzvxqnxkblskiqfgmprmnlcsweefw
zudzjwobzyzajrihmxgofslfofxxndaxgecyyqospgpyshlhcmzjlbxynzpkxbzzvxqnxkblskiqfgmprmnlcmyqisyadolwn
zemkxgecyyqospgpyshlhcmzjlbxynzpkxbzzvxqnxkblskiqfgmprmnljnppqzmt
jiz...

output:

53

result:

ok single line: '53'