QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#292274 | #7955. Tandem Copy | PhantomThreshold# | AC ✓ | 351ms | 4128kb | C++17 | 1.6kb | 2023-12-27 22:22:21 | 2023-12-27 22:22:21 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn = 20005;
int n,m;
string S,T;
int match(int h,int i,int j)
{
if(S[i]!=T[j]) return -1;
if(j==m) return i;
if(h==0)
{
if(i==n) return -1;
if(S[i+1]!=T[j+1]) return -1;
//i,ri
//j,rj
int ri,rj;
ri=i;
while(ri<=n && S[ri]==S[i+(ri-i)%2])ri++;
ri--;
rj=j;
while(rj<=m && T[rj]==T[j+(rj-j)%2])rj++;
rj--;
if(rj==m)
{
return i+1;
}
else //rj!=m
{
if( (ri-i)%2 != (rj-j)%2 ) return -1;
if( ri-i > rj-j ) return -1;
return match(0,ri,rj);
}
}
else if(i-1>0 && S[i-1]==T[j+1])
{
int ri,rj;
ri=i;
while(ri<=n && S[ri]==S[i-1+(ri-i+1)%2])ri++;
ri--;
rj=j;
while(rj<=m && T[rj]==T[j+(rj-j)%2])rj++;
rj--;
if(rj==m)
{
return i;
}
else //rj!=m
{
if( (ri-i+1)%2 != (rj-j)%2 ) return -1;
if( ri-i+1 > rj-j ) return -1;
return match(0,ri,rj);
}
}
return -1;
}
int ri[maxn];
int main()
{
ios_base::sync_with_stdio(false);
cin>>S>>T;
n=S.size(); m=T.size();
S=' '+S; T=' '+T;
string tempt;
for(int i=1;i<=m;i++)
{
if(T[i]!=T[i-1]) tempt=tempt+T[i];
}
T=tempt;
m=T.size();
T=' '+T;
for(int i=1;i<=n;i++) ri[i]=n+1;
for(int i=n;i>=1;i--)
{
int j=match(0,i,1);
if(j!=-1) ri[i]=min(ri[i],j);
if(i-1>0)
{
j=match(1,i,1);
if(j!=-1) ri[i-1]=min(ri[i-1],j);
}
}
ll ans=0;
for(int i=n,R=n+1;i>=1;i--)
{
if(ri[i]!=n+1) R=min(R,ri[i]);
if(R!=n+1) ans+=n-R+1;
}
cout<<ans<<endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3768kb
input:
ACGCG CCG
output:
9
result:
ok single line: '9'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
TATCGC TTCCG
output:
6
result:
ok single line: '6'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
ABCABC ABC
output:
7
result:
ok single line: '7'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
ABCABC ABCABC
output:
1
result:
ok single line: '1'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
FUSBX UUUUUUUUUU
output:
8
result:
ok single line: '8'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
IWN NNNNNNNNNN
output:
3
result:
ok single line: '3'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
RMRMRMRMRMRMRMRMRMRMR MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMR
output:
210
result:
ok single line: '210'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
TY YT
output:
1
result:
ok single line: '1'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
WZ ZW
output:
1
result:
ok single line: '1'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
SBSBSBSBSBSBSBSBSBSBSBSBSBSBSBSBSBSBWGVXPWAXMSBSB SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS...
output:
1121
result:
ok single line: '1121'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
TGJPXPXPXPXPXPXPXPXPXPXPXPXPXPXPXPXPXPXPXPX PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP...
output:
897
result:
ok single line: '897'
Test #12:
score: 0
Accepted
time: 1ms
memory: 3668kb
input:
MKZOLDYLGAULULULUGASEAOZVIHNMRGKZQEIQYTGEMLBMAULULULULULULULPNERGKYZARPULULULULULAOZLQGYHULULULULZKYZUXEBVXZBULULULULULULULULULULULULULULULULDCEXCSTHQRULULULULULULULULULULULULULULULULULRDMPBDULULULUFVXWEMTULULULULULULULULULULULULULULULULULULULULCLULULULULULULULULULULULULULULULULULULULULULULULULULULU...
output:
46504613
result:
ok single line: '46504613'
Test #13:
score: 0
Accepted
time: 2ms
memory: 3684kb
input:
VEPZEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEMEM...
output:
43715406
result:
ok single line: '43715406'
Test #14:
score: 0
Accepted
time: 1ms
memory: 3652kb
input:
HKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKFBIAHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKIHKHKHKHKHKHKHKHKHKHKHKBHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHKHK...
output:
45393402
result:
ok single line: '45393402'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
ZHJDKBQNJPACACACACACACACACACACACACACACACACACACACACACACACEZACACACACACACACBLCRDQEACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACGUEKSAJOFACACACACACACACACACACACACACACACACACACACACACACKHUIOCNKXMKUOKACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACRACACACACACACACACACA...
output:
45452856
result:
ok single line: '45452856'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3680kb
input:
CXQKRAVWKJFOHVJVMNSBGOEJZFAESPYDZCLUOHLBQEHIDLWQWQWQWQWQWQWQRETGMKPFZQWQWQWQWQWQWQWQWQWQWQWQWQWQWQWQSWLXQVWQWQWQWQWQWQWQWQVEHITSVRXBHEWCARSTKQZERXDNJTXGIHTBMCVYSKPSFYIDRGAIEVSTJGUBGMSQFXGWQFHBCTMGOWQWQWQWQWQWQWQPEYDLNUGDIOEKHRNSROPWQWQWQWQWQWQWQWQWQCMSPXODTIKOZYPFHROYFECRUJDWQWQWQWQWQWQWQWQWQWQJUWJK...
output:
49328004
result:
ok single line: '49328004'
Test #17:
score: 0
Accepted
time: 2ms
memory: 3744kb
input:
CBFKLKDEFBGHCEAMJIKGMLJFDKFIDJAKIADCHEJAMJBIFBJCEJCKDFLAFMEGDAMHLDCFGDBJDKLGIDCBMAFBMLFDJGAMLEAHBCIDLFJKCGHILCEDBLKIDMJDICBMFKLDKGLKMLFGKIDGHJIKJHBAJFMLJMEHGFEGAHBJLEBHKAJCKADEFGIEMGKCGMBEJKCFGAIMJBDGFHEMAELCDHCFJGAKEBJFHBDMKEMCJIKLGMCFJGDFLBACHECJMECIDGBKJHMEHILCKIBCLIFMHJFDGAILEBGIAJIFCILFJBLFALGB...
output:
0
result:
ok single line: '0'
Test #18:
score: 0
Accepted
time: 0ms
memory: 3760kb
input:
JIDABCASN ABCBABCBC
output:
0
result:
ok single line: '0'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
ASFJABCSFN ABCABC
output:
0
result:
ok single line: '0'
Test #20:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
ELUNVXDGQHAYMVWAYBQUJIMOFNOVPTALPHTWCPDMALKAZEAPXFMZCTLKHFIYPUOYKIVLNGHTXSJNIHZURWNYNXBMWOVZYXAQDKFWTHCYVQNFMNIQRFWKTQYHAVJOXNMPTIRWLJXERAWFSZKVOWTNXOTXSTWIGNCEKWDEADLSWHCQDPECUXEKAFEHPKHLTHPFYLUBXGMKENZTOQZKAESFNIQAKUVWPNQAPEHAVIWFAOIXMBPJITYOLTKYGAWKBDOZJUFOVCPGDFZLFQIGEBDEMNUPYEKWSCGDOUWEOJXMAHGZ...
output:
0
result:
ok single line: '0'
Test #21:
score: 0
Accepted
time: 1ms
memory: 3856kb
input:
QAUFICKQDARDZBSWEMXFDPAUJVBDHVTAZDJRMXVNQYBWJLOSONYGXZNKURCGHMXFGZSQIGSRMPSDJGLFUWZJVMDAGUFOXIFHCTWLMLTSMJLOSCLYEYEXZKBEVMORHAGMKCMPIBZXCMNVOEXBJOYBHMVZHBYMVBFLNZPSDZBUEOCZJHZEAUZREVNLIDNHCYBJVBGPSVKSNHTUONLREOIPVTRXIZAYRAPZVYENZVXYIWZLQOVTGZPUAMBSWFVIUHJNACLOFVGNSKPMTSYLVTUIPWKVJYLWKGWZBGCEBVDYTVYI...
output:
0
result:
ok single line: '0'
Test #22:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
BIUBEMOYSEHTDAYBGSTIEGZAFLQFRKXZHKMLIZORXMYPRIPZVSBPVJYHMFBKVIFXAYFJQCPEGPERASKTJFNYVXNXALJGSABVIEURYVHBVEIAZUXSPANGABQRZHTKQJBTEWLGSTAMEFSZHBZOFDWPXMAZYDPIWXSIMYELONUAJXHBZWSFKEABYQKFRIWYVIFQBLSQJKRTLONRQBJARCKJTKGFIWFRDNYICDQXLIJUVXZNJKGQTEUXGHAEYHWBXYCOSMTPIXRYKIGQLMJCYDIKSPZMCSEHWRHAXEQCZYHXOSWU...
output:
0
result:
ok single line: '0'
Test #23:
score: 0
Accepted
time: 2ms
memory: 3756kb
input:
TGZBZAEQDTWERZFYHZPTVHCLFIVBCOTZAKVSXYUXHLCRIDGLJEWULEVJEZSXUCPXBPCVLACGKCLNRPLVPUWKSOWXREVIHXDSQWCLYEBHOMDYHGQVZADJOSQMBUSKGVEQOMKLBCWNUGOLFZXEPRCZKWJXEZVOWNGVEDQYJIECTMQHXOVPYZDUBZMFBJWZHMAVMWZPFUYXVKLERIPRVMWYUSOZFYAKDZMQDEUSGMVSDHBYFIPOGKIAYHRTBYPGOXMGYSRHWRIZBIZWQITLFKYRWASGAPLUFMIUZJTRVYJLZCQV...
output:
0
result:
ok single line: '0'
Test #24:
score: 0
Accepted
time: 0ms
memory: 3884kb
input:
AIEYDRNKWSEGPLDXVHXFMSJGUQFVNRXTQPVQZHWEHUBVAUPUTCQJYTEBJWEULSDIPVQPNGIODAZRSUQFYEMZEQDALGHMNLETNXTNECTOQGIEVAJFPATYDXIHEGAPMRQUTGCNUTJHFSZJDIUFXHBEMWHDCIYJUGYTHOCEZRTHXWHEWFIVONEGUMKGIENRALWBJLSQAYOFZLBXMAOXPIMTSJEFZEGNMQSPUCZHMRDNVPKJVATROZAQGFOWCTUVKOMVWDAXLRMOZHNEAHUOKEDSYJRAWQLMRUDQCXOTBQOXGRBG...
output:
0
result:
ok single line: '0'
Test #25:
score: 0
Accepted
time: 0ms
memory: 3744kb
input:
ZJPVDHIXEZCWVXWOZYEILQHRPRQZORZQBLIXHCKPGJYIZDBZDENDLPHYRMAONHOAKTHMTKHJBFJYRKQTHLZHTPKJQSXZEHRQGBPRWDMFHWTJZTJCEYLZAJCMEKXHJORTJMFHNAEMJBOLTUYXVLXCZFUNRIGVESCBHSVGUXRMUKIRCAXCIYSCLYCBADRGTQGZTWDBMOEWHPFRXPISNECTFVQRJZUJRGLYMOWHFZDXAMHTCRLXPOMKCXSVGKHJVLDRAHDYMWHURFOJCYPLVYLVUMAZDEHCNBOQWBYIPMDYXUTO...
output:
0
result:
ok single line: '0'
Test #26:
score: 0
Accepted
time: 1ms
memory: 3952kb
input:
QKNDNBUGVUTWQVNETHRWEUWFHJEYGKLAHKSALTHQCTSPFOUMTGWSGCLYIQDPERLHMXZQIAFBVGDQRJWPCFTRQSNRYVPRYCHQUBCYHRAMQXFBXMVXCPXVOIFUYZVOAFMARDSEQPENUAEQWVNBMVJXTBKYTEMCSOPHSRDMWZPQLWVLIAPWNRVQCNBEXGWZXOFRKBJFCUQWNCRURAQLFPSXBSUOFQCRGCVGQYDHXBESHMZJOTLXAUOECHBOEDHRIJRAHELBYXWSQGPXITSRKDNFXSTZYXHSGIPWAZMDUZIXVJGU...
output:
0
result:
ok single line: '0'
Test #27:
score: 0
Accepted
time: 351ms
memory: 3852kb
input:
ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...
output:
0
result:
ok single line: '0'
Test #28:
score: 0
Accepted
time: 6ms
memory: 3852kb
input:
CBABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...
output:
0
result:
ok single line: '0'
Test #29:
score: 0
Accepted
time: 179ms
memory: 4128kb
input:
ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB...
output:
0
result:
ok single line: '0'
Test #30:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
INBHJGLCDJGRSNWHTXFEGIAWVWXROMSYXZTFCBHWTIXCBZEJZFGPZKAXTJFQVDTANSJCETHIPGHFELUHBTZRIOBTMLYMRCQDVNCAUIXQTZKAGMPWLUVJFVAZMRXAOSDYJHYKISJTSMTQYCIFTNHECWDYIWGEVZMLBMUJYOKALXYVUTWVBKDBRIUJGTKMUFHWZOCPNIYONVYHVRGPFCWFJQKDLRXFOGSOXEZBIZEWLNROMXZWIFHDCHFEDMUITXCPLTWQCBLXFJQUZSOHXKLFRPTYPNODIXMSUXNSBQHKAWCJ...
output:
0
result:
ok single line: '0'
Test #31:
score: 0
Accepted
time: 5ms
memory: 3944kb
input:
TFQCDUYXLOYHPUIHIKATDYXRVKLWDBGSHPQTVSBKHONRAKTDJSERAIODSCQOEKCTHAGXRVPHEMOTUBETNUCWDHEOWJPMGKTZCPWVPGRBTWISZHPQABQULBKDQURQHRCMPEKHOLGTQNHFXWPXARBSJNLEPYZVEJSYFVYAQIULITNEFKLGMLWXCVGJSBTNRBQTXOACDVHYLKWZVFAJDNLSBEOWPTZSOGVTJACIUNZJTANFIGQMFLMHSATMPXEOVXLGMOEUZYHNTHVKOMGLJRSMVXQYVOMJEHZGNJVNOGBUCKQF...
output:
0
result:
ok single line: '0'
Test #32:
score: 0
Accepted
time: 2ms
memory: 4032kb
input:
QWKDETMOTCFHWAKLRYCJLQBHMGXEBFEYIFIQYKOURSTXEBXUETDXAQBYKSJIZKWMSIAPSYZQICSJBPSAKUPEFJLMODTHSNBIHLKNGMRQNYLFTVPYUQDPUVINLIMRGSWULQDYQVKRDWHAVQARIWXPFRBFZDFPZVFMUFDRIPSWEQYEQGOXHEOGHEGDRAGHTUYMQJHKGREXHQATPHWGAHYIVAFIQHOPYSRENZKAHBCFVPZKWPIGNIYOUXFQKZURTKIHFOJBMHOLFDWOEJHDVLWZEPDVMCSPWKJEXLEKGBUCOZDI...
output:
0
result:
ok single line: '0'
Test #33:
score: 0
Accepted
time: 0ms
memory: 3760kb
input:
PMONBRZUXLXOMICDOYGCDRILAPJCUISVFCWUXHDUBXTVPGVKAUGYBDRBMXNDWHMSRZFMRXSVDSNZQXBMDUNEYZDWOKAERTSMEYJCLFWYLNHCOQKDLTJPMNCJWLZGKVHERNZQYSFTQGSXDYQRWSDFMRHCFEYHEZBENBQRYMPXDWIBRFGRIGMPWNISLDIYBKIJKTSVJRHZUOWZONHAXTDZIHSABHFXYWLJTADJGREOVSJYTAIUSAJPQUFNXBZVTWONZUODJBNGXFDAODBJGHRQXLMBWTUXFEVZWLJPINSBMGTJ...
output:
0
result:
ok single line: '0'
Test #34:
score: 0
Accepted
time: 5ms
memory: 4068kb
input:
IGOCPESZSKCGJBLHDFKLNBENRFXNQAYFVLNWPTDYFANZMCARIMZKEPWQTYCPJILYNOVJSFEZWOBNJKGSEGFJIQOHUYTHXVKUAISVPRMUXAKXZVJWQMFNWLAQENGTORCLDTRBNZLENSKQFLGMJHWBIUMAQJCUTWRMXYKLXWLSNDSVITYZHCBYGJSRKHPUBQCZSIMEROWVYLAQNLQOYEMGSLTNQETDXZWEQUSMCGALKITMKOIFDQRWYCUTWJVIMSTCOADHIJPLWRKXHGNOMSGPXFADBMZTILHROCSARTLPDRFC...
output:
0
result:
ok single line: '0'
Test #35:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
UNINININININIUNININIUNINININININININIU NINININIUNININIU
output:
216
result:
ok single line: '216'
Test #36:
score: 0
Accepted
time: 1ms
memory: 3640kb
input:
ISISISISISISISISISISISISISISISISISISISISISISISISISISREKMYLWDISISISISISISISISISISISISISISISREKMYLWDISISISISISISISISISISISISISISISISISISISISISISISISISISISISISISISREKMYLWDISISISISISISISISISISISISISISISISISISISISISISISISISISREKMYLWDISISISREKMYLWDISISISISISISISISISISISISISISISISISISISISISISISISISISISREKM...
output:
51
result:
ok single line: '51'
Test #37:
score: 0
Accepted
time: 1ms
memory: 3640kb
input:
XIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXICMFRZUDTXIXIXIXIXICMFRZUDTXIXIXIXIXIXIXIXICMFRZUDTXIXIXIXIXIXIXIXIXIXIXIXIXIXICMFRZUDTXIXIXIXIXICMFRZUDTXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXICMFRZUDTXIXIXIXIXIXIXIXIXIXICMFRZUDTXIXIXIXIXIXIXIXIXIXIXIXIXIXIXICMFRZUDTXIXIXIXIXIXIXIXI...
output:
65
result:
ok single line: '65'
Test #38:
score: 0
Accepted
time: 1ms
memory: 3700kb
input:
VXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXAYMUCTBSVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXAYMUCTBSVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXAYMUCTBSVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXVXAYMUCTBSVXVXVXVXAYMUCTBSVXVXVXVXVXVXVXVXVXVXVXAY...
output:
89
result:
ok single line: '89'
Test #39:
score: 0
Accepted
time: 1ms
memory: 3860kb
input:
VHUONWASGSGSGSGSGSGSGSGZVHUONWASGSGSGSGSGSGSGSGZVHUONWASGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGZVHUONWASGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGZVHUONWASGSGSGSGSGSGSGSGZVHUONWASGSGSGSGSGSGSGSGSGSGSGZVHUONWASGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGSGZVHUONWASGSGSGSGSGSGS...
output:
1
result:
ok single line: '1'
Test #40:
score: 0
Accepted
time: 1ms
memory: 3692kb
input:
BCVHNXIPYVXJCTQHQMBPOPOPOPOPOPOPOPOPOPOPOPOPOPOHTVSIRHVZGXUSBEFYJPQMWPZEJAKDBCVHNXIPYVXJCTQHQMBPOHTVSIRHVZGXUSBEFYJPQMWPZEJAKDBCVHNXIPYVXJCTQHQMBPOPOPOPOPOPOPOPOPOPOPOPOPOPOHTVSIRHVZGXUSBEFYJPQMWPZEJAKDBCVHNXIPYVXJCTQHQMBPOPOPOPOPOPOPOPOPOPOHTVSIRHVZGXUSBEFYJPQMWPZEJAKDBCVHNXIPYVXJCTQHQMBPOPOPOPOPOP...
output:
111508271
result:
ok single line: '111508271'
Test #41:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
YAIYPFTHYPYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOTWPZLUNKPEZGUWOZYJDCGNQMCEZGRLQCRTBRFOYAIYPFTHYPYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOTWPZLUNKPEZGUWOZYJDCGNQMCEZGRLQCRTBRFOYAIYPFTHYPYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOYOTWPZLUNKPEZGUWOZYJDCGNQMCEZGRLQCRTBRFOYAIYPFTHYPYOYOYOYO...
output:
108087831
result:
ok single line: '108087831'
Test #42:
score: 0
Accepted
time: 1ms
memory: 3648kb
input:
DKSZCDQIRHZTBAUBVJEIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHEWQGYVCRLQCIEOMOPTZUAEINRCVKHDKSZCDQIRHZTBAUBVJEIHIHIHEWQGYVCRLQCIEOMOPTZUAEINRCVKHDKSZCDQIRHZTBAUBVJEIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHIHEWQGYVCRLQCIEOMOPTZUAEINRCVKHDKSZCDQIRHZTBA...
output:
111382463
result:
ok single line: '111382463'
Test #43:
score: 0
Accepted
time: 1ms
memory: 3700kb
input:
CETFSXRJRJRJRJRJRJRJRJRJRJRJRJRJRJRJRJRJRJRJRJRJRJRJRJRJRJRJRJRJRJRJSUIYRGHQCEWGRKNDABIKHPVLTFVSUQAKTZQCMABOKYCETFSXRJRJRJSUIYRGHQCEWGRKNDABIKHPVLTFVSUQAKTZQCMABOKYCETFSXRJRJRJRJRJRJRJRJRJRJRJRJRJRJRJRJRJRJSUIYRGHQCEWGRKNDABIKHPVLTFVSUQAKTZQCMABOKYCETFSXRJRJRJRJRJRJRJSUIYRGHQCEWGRKNDABIKHPVLTFVSUQAK...
output:
109032047
result:
ok single line: '109032047'
Test #44:
score: 0
Accepted
time: 1ms
memory: 3892kb
input:
POVYJTOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUOUNCMCIZCHBTYWIVKCXIYWMVTGABERTBWQMLWFAYEDMXPOVYJTOUOUNCMCIZCHBTYWIVKCXIYWMVTGABERTBWQMLWFAYEDMXPOVYJTOUOUOUOUOUOUOUNCMCIZCHBTYWIVKCXIYWMVTGABERTBWQMLWFAYEDMXPOVYJTOUOUOUNCMCIZCHBTYWIVKCXIYWMVTGABERTBWQMLWFAYED...
output:
109220231
result:
ok single line: '109220231'