QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#528751#4844. Positive StringNanani_fan#AC ✓112ms133636kbC++202.9kb2024-08-23 20:53:232024-08-23 20:53:23

Judging History

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

  • [2024-08-23 20:53:23]
  • 评测
  • 测评结果:AC
  • 用时:112ms
  • 内存:133636kb
  • [2024-08-23 20:53:23]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1e6 + 10;//2*strlen
struct Suffix{
	int ht[N],rk[N],sa[N],y[N],c[N];
    int n,m;
    char s[N];
	void init(){
        n=strlen(s+1);
        m=300;
		for(int i=0;i<=m;i++) c[i]=0;
		for(int i=0;i<=2*n;i++) y[i]=0;
		for(int i=1;i<=n;i++) c[rk[i]=s[i]]++;
		for(int i=1;i<=m;i++) c[i]+=c[i-1];
		for(int i=n;i>=1;i--) sa[c[rk[i]]--]=i;
		for(int k=1;k<=n;k<<=1){
			int p=0;
			for(int i=n-k+1;i<=n;i++) y[++p]=i;
			for(int i=1;i<=n;i++){
				if(sa[i]>k){
					y[++p]=sa[i]-k;
				}
			} 
			for(int i=0;i<=m;i++) c[i]=0;
			for(int i=1;i<=n;i++) c[rk[i]]++;
			for(int i=1;i<=m;i++) c[i]+=c[i-1];
			for(int i=n;i>=1;i--) sa[c[rk[y[i]]]--]=y[i];
			for(int i=0;i<=n;i++) swap(rk[i],y[i]);
			rk[sa[1]]=p=1;
			for(int i=2;i<=n;i++){
				rk[sa[i]]=(y[sa[i]] == y[sa[i-1]] && y[sa[i]+k] == y[sa[i-1]+k] ? p : ++p);
			}
			if(p>=n) break;
			m=p;
		}
		for(int i=1,k=0;i<=n;i++){
			if(k)k--;
			int j=sa[rk[i]-1];
			while(s[i+k] == s[j+k] )k++;
			ht[rk[i]] = k;
		}
	}
    void writ()
    {
        printf("%s\n",s+1);
        for(int i=1;i<=n;i++)cout<<sa[i]<<" ";;cout<<"\n";
        for(int i=1;i<=n;i++)cout<<ht[i]<<" ";;cout<<"\n";
        for(int i=1;i<=n;i++)cout<<rk[i]<<" ";;cout<<"\n";
    }
    
};
Suffix suf;
struct Treearray{
    int c[N],n;
    void set_n(int _n){
        n=_n;
        for(int i=1;i<=n;i++)c[i]=0;
    }
    int lowbit(int x){
        return x&(-x);
    }
    void update(int i,int k){    //在i位置加上k
        while(i <= n){
            c[i] += k;
            i += lowbit(i);
        }
    }
    int getsum(int i){        //求A[1 - i]的和
        int res = 0;
        while(i > 0){
            res += c[i];
            i -= lowbit(i);
        }
        return res;
    }
};
Treearray tri;
int st[20][N];
int get(int l,int r){
    int g=__lg(r-l+1);
    return min(st[g][l],st[g][r-(1<<g)+1]);
}
int lcp(int i,int j){
    i=suf.rk[i],j=suf.rk[j];
    if(i>j)swap(i,j);
    return get(i+1,j);
}
signed main()
{
    scanf("%s",suf.s+1);
    int n=strlen(suf.s+1);
    suf.s[n+1]='#';
    for(int i=1;i<=n;i++)suf.s[2*n-i+1+1]=suf.s[i];
    suf.init();
    tri.set_n(2*n+1);
    for(int i=1;i<=2*n+1;i++)st[0][i]=suf.ht[i];
    for(int j=1;j<20;j++){
        for(int i=1;i+(1<<j)-1<=2*n+1;i++){
            st[j][i]=min(st[j-1][i],st[j-1][i+(1<<(j-1))]);
        }
    }
    for(int i=n+2;i<=2*n+1;i++)tri.update(suf.rk[i],1);
    int ans=0;
    for(int i=1;i<=n;i++){
        ans+=tri.getsum(suf.rk[i]);
        tri.update(suf.rk[2*n+1+1-i],-1);
    }
    for(int i=1;i<=n;i++){
        {//mid = i
            if(suf.rk[i]>suf.rk[2*n+1+1-i]){
                ans-=lcp(i,2*n+1+1-i);
            }
        
        }
        if(i+1<=n){
            if(suf.rk[i+1]>suf.rk[2*n+1+1-i]){
                ans-=lcp(i+1,2*n+1+1-i);
            }
        }
    }
    cout<<ans;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 24304kb

input:

jjikkollp

output:

4

result:

ok 1 number(s): "4"

Test #2:

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

input:

pbpbppb

output:

7

result:

ok 1 number(s): "7"

Test #3:

score: 0
Accepted
time: 59ms
memory: 131940kb

input:

tttbdckvkpisriwezmudlrwfkzxjtwrkhxmpqtfunhombmpqygpibgjvnyrjzvnkvwcsgtcdifujfqanmrvwkuxhgtntanazgeaermjdlrcbppwxsrdykkyxalfxsgjyktafbyrnlekwwbfsxbnwjfkkmwtcnytkbqqlfxxxfiomtsvyefkiojehqmvezcprdsxafpxjuvxcbwyjuugzcoszeuqzupgzwrykubltkeyiqdegtrtjxrjadqbngrktaflcatkuhofycrtxpaacfmtwmtheagxwynmibnrpwoej...

output:

9987275747

result:

ok 1 number(s): "9987275747"

Test #4:

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

input:

a

output:

0

result:

ok 1 number(s): "0"

Test #5:

score: 0
Accepted
time: 55ms
memory: 130796kb

input:

dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd...

output:

0

result:

ok 1 number(s): "0"

Test #6:

score: 0
Accepted
time: 63ms
memory: 131628kb

input:

cccccccccccccccccccccccccccccccccccccccccccccccccxcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccocccccccccccccccccccccccccccccccccccccccccccccxcccccccccccjcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc...

output:

10020572944

result:

ok 1 number(s): "10020572944"

Test #7:

score: 0
Accepted
time: 58ms
memory: 131024kb

input:

ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttjttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttetttttttttttttttttt...

output:

10270918647

result:

ok 1 number(s): "10270918647"

Test #8:

score: 0
Accepted
time: 31ms
memory: 92784kb

input:

ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooocoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo...

output:

2531342670

result:

ok 1 number(s): "2531342670"

Test #9:

score: 0
Accepted
time: 51ms
memory: 131424kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

0

result:

ok 1 number(s): "0"

Test #10:

score: 0
Accepted
time: 48ms
memory: 127884kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

0

result:

ok 1 number(s): "0"

Test #11:

score: 0
Accepted
time: 20ms
memory: 89492kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

0

result:

ok 1 number(s): "0"

Test #12:

score: 0
Accepted
time: 46ms
memory: 131268kb

input:

zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

output:

19230655235

result:

ok 1 number(s): "19230655235"

Test #13:

score: 0
Accepted
time: 53ms
memory: 128004kb

input:

zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

output:

19230527746

result:

ok 1 number(s): "19230527746"

Test #14:

score: 0
Accepted
time: 16ms
memory: 93088kb

input:

zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

output:

4807659003

result:

ok 1 number(s): "4807659003"

Test #15:

score: 0
Accepted
time: 48ms
memory: 133636kb

input:

aaaaaaaaaaeataagaaaaaaaaaaualapaaaaagaaaaaafamaaaaaaaalaaaaaaaaaaaaaiaapagaaaxaaaaaaaaaaiaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaafaaaayavayaaaiaiaaaoaaaaaaaeaaaaaauaaaaaaaaaaaauahayaaaaaaaaaaaaxaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaauaaaaaaaanaaanaaahaaaaaaaaaaaaaaaaaajaaanaaaaaaaaqaraaaaaaaaaaaaaaaaaaca...

output:

2289060770

result:

ok 1 number(s): "2289060770"

Test #16:

score: 0
Accepted
time: 50ms
memory: 128832kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

447195772

result:

ok 1 number(s): "447195772"

Test #17:

score: 0
Accepted
time: 28ms
memory: 87396kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaqaaaaaaaaaaaaaaaaaaaaaaaraaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

145781946

result:

ok 1 number(s): "145781946"

Test #18:

score: 0
Accepted
time: 44ms
memory: 132588kb

input:

zzzzzzzzzzzzuztzzzzzzzzzzwzzczzzzzczzzzzzzzzzzzwzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzgzzzzzizzzzzzlzzzzzzzzzzzzzzzzwzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzazzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzkzzzzizzzzzzzzzzzzzzzzzzmzzzzzzzzzzzzzzzzzzzzzzzzzzzezzzzzvzzzzzizzzzzzzzzzzzzzmzzzzfzrzzzzzbuzzzzzzzzzz...

output:

18409032362

result:

ok 1 number(s): "18409032362"

Test #19:

score: 0
Accepted
time: 40ms
memory: 131964kb

input:

zzzzgzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzwzzzzzgzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzdzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzezzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

output:

19438576443

result:

ok 1 number(s): "19438576443"

Test #20:

score: 0
Accepted
time: 26ms
memory: 90220kb

input:

zzzszzzznzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzmzzznzzzjzzzzpzwzzzzzzzzzzzzzzzzzzzzzzwzzzzzzzzzzzezzzzkzzzzzbzzzzzzzzzzzzzzzzzzzzzzzzzzzzzczzzzzzzzzzzfmzzczzzzsmzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjzzzzzzzzzzzzzzwzzzzzzzzzzuzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzvzzzzelz...

output:

4680731829

result:

ok 1 number(s): "4680731829"

Test #21:

score: 0
Accepted
time: 112ms
memory: 128556kb

input:

pacsknzvgzskpqcxdaivkhhkviadxcqpkszgvznkscappacsknzvgzskpqcxdaivkhhkviadxcqpkszgvznkscappacsknzvgzskpqcxdaivkhhkviadxcqpkszgvznkscappacsknzvgzskpqcxdaivkhhkviadxcqpkszgvznkscappacsknzvgzskpqcxdaivkhhkviadxcqpkszgvznkscappacsknzvgzskpqcxdaivkhhkviadxcqpkszgvznkscappacsknzvgzskpqcxdaivkhhkviadxcqpkszg...

output:

9973238297

result:

ok 1 number(s): "9973238297"

Test #22:

score: 0
Accepted
time: 109ms
memory: 131724kb

input:

oaeszxkfsyqlxiavjaehbvsyvfzunkknuzfvysvbheajvaixlqysfkxzseaooaeszxkfsyqlxiavjaehbvsyvfzunkknuzfvysvbheajvaixlqysfkxzseaooaeszxkfsyqlxiavjaehbvsyvfzunkknuzfvysvbheajvaixlqysfkxzseaooaeszxkfsyqlxiavjaehbvsyvfzunkknuzfvysvbheajvaixlqysfkxzseaooaeszxkfsyqlxiavjaehbvsyvfzunkknuzfvysvbheajvaixlqysfkxzseao...

output:

9973273540

result:

ok 1 number(s): "9973273540"

Test #23:

score: 0
Accepted
time: 46ms
memory: 89484kb

input:

zzqwejqiyypyawscjcbalvyjanyekkeynajyvlabcjcswaypyyiqjewqzzzzqwejqiyypyawscjcbalvyjanyekkeynajyvlabcjcswaypyyiqjewqzzzzqwejqiyypyawscjcbalvyjanyekkeynajyvlabcjcswaypyyiqjewqzzzzqwejqiyypyawscjcbalvyjanyekkeynajyvlabcjcswaypyyiqjewqzzzzqwejqiyypyawscjcbalvyjanyekkeynajyvlabcjcswaypyyiqjewqzzzzqwejqiyy...

output:

2486021051

result:

ok 1 number(s): "2486021051"

Test #24:

score: 0
Accepted
time: 67ms
memory: 131460kb

input:

cnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnc...

output:

9439930932

result:

ok 1 number(s): "9439930932"

Test #25:

score: 0
Accepted
time: 90ms
memory: 130752kb

input:

oyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryo...

output:

9704207014

result:

ok 1 number(s): "9704207014"

Test #26:

score: 0
Accepted
time: 35ms
memory: 87460kb

input:

tuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihut...

output:

2431144645

result:

ok 1 number(s): "2431144645"

Test #27:

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

input:

ultejuinafygvtkglxcpwbwqonryoocxlvyraiisvmonhhkqwrnhtkwfwwoglvywbslptaspzyaaecemiprcithpmlobcxnajbhpmofqkelnknjtoqklrocwlkgtkzlvvpqrqjbxhevdhcdcadwmtkmimzpcbhynttydoyxjdlehnfsnuegnzwchipqbtgfutlasedxgpyprxbkghrkfnqwohhicjgrqyuvqsylxethjevtiofztjfhpmvjgmlixpvmprkizxglesjlohjzrarusfutrzbokqowzfdrxxwnu...

output:

25310346

result:

ok 1 number(s): "25310346"

Test #28:

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

input:

iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii...

output:

0

result:

ok 1 number(s): "0"

Test #29:

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

input:

nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnndnnnnnnnnnnnannnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnndnnnnnnnnnnnnn...

output:

25496433

result:

ok 1 number(s): "25496433"

Test #30:

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

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

0

result:

ok 1 number(s): "0"

Test #31:

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

input:

zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

output:

48074404

result:

ok 1 number(s): "48074404"

Test #32:

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

input:

aaaaaaaaaaaaagaaaaaaaaaaaaaaaaaaaeaagkaaakaqaaaaaaaaaaaaaaaaaaaaeaaaaaaaajaaaeaaaaaaaapaaaoaaaaalaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaauaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaiaaaaaaaaaasaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaaaaaaaawaaaaaaaaaaaaaaaaaaaaaaaaaaaaahaaaaaaaaaaauaaaaaaaaaaaaaaacaaaaaaauaa...

output:

2831203

result:

ok 1 number(s): "2831203"

Test #33:

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

input:

zzzzzzzzzzzzzzzyzzzzzzzzzzzzzzzzzzzzjzzzzzzzzzzzzzzzzzzzzzzzzzbzzzzzzuzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzozzzzzzzzzzzzzzzzzzzzzzzfzzzzzzzzzzzzzzzzuzzzzzzzzzzzzzzzzzzzzzazzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzqzzzzzzzzzzzzzizzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzvzzz...

output:

47656154

result:

ok 1 number(s): "47656154"

Test #34:

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

input:

dqeybhneaaggaaejsbukuihukkuhxxxxhukkuhiukubsjeaaggaaenhbyeqddqeybhneaaggaaejsbukuihukkuhxxxxhukkuhiukubsjeaaggaaenhbyeqddqeybhneaaggaaejsbukuihukkuhxxxxhukkuhiukubsjeaaggaaenhbyeqddqeybhneaaggaaejsbukuihukkuhxxxxhukkuhiukubsjeaaggaaenhbyeqddqeybhneaaggaaejsbukuihukkuhxxxxhukkuhiukubsjeaaggaaenhbyeqd...

output:

24694861

result:

ok 1 number(s): "24694861"

Test #35:

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

input:

xbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbx...

output:

24694646

result:

ok 1 number(s): "24694646"