QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#57905#4844. Positive StringSorting#AC ✓693ms14988kbC++2.1kb2022-10-23 20:00:282022-10-23 20:00:28

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-23 20:00:28]
  • 评测
  • 测评结果:AC
  • 用时:693ms
  • 内存:14988kb
  • [2022-10-23 20:00:28]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fi first
#define se second
const int N=4e5+5;
int n;
string s,t;
int rnk[400005];
pair<ll,int>funny[400005];
array<vector<int>,2>manacher(string s){
	array<vector<int>,2>p;p[0].resize(n+1);p[1].resize(n);
	for(int z=0; z<2 ;z++){
		for(int i=0,l=0,r=0; i<n ;i++){
			int t=r-i+!z;
			if(i<r) p[z][i]=min(t,p[z][l+t]);
			int L=i-p[z][i],R=i+p[z][i]-!z;
			while(L>=1 && R+1<n && s[L-1]==s[R+1]){
				p[z][i]++,L--,R++;
			}
			if(R>r) l=L,r=R;
		}
	}
	return p;
}
int bit[N];
void upd(int id){
	for(int i=id; i<=n ;i+=i&-i) bit[i]++;
}
int qry(int id){
	int res=0;
	for(int i=id; i>=1 ;i-=i&-i) res+=bit[i];
	return res;
}
int main(){
	ios::sync_with_stdio(false);cin.tie(0);
	cin >> s;n=s.size();
	if(n==1) return cout << "0\n",0;
	t=s;reverse(t.begin(),t.end());t=s+t;
	t='?'+t;
	//cout << s << ' ' << t << endl;
	{//suffix array
		for(int i=1; i<=2*n ;i++) rnk[i]=t[i];
		for(int i=1; (1<<i)<4*n ;i++){
			ll mg=1e9;
			for(int j=1; j<=2*n ;j++){
				if(j+(1<<(i-1))>2*n) funny[j]={rnk[j]*mg,j};
				else funny[j]={rnk[j]*mg+rnk[j+(1<<(i-1))],j};
			}
			sort(funny+1,funny+2*n+1);
			int ptr=1;
			for(int j=1; j<=2*n ;j++){
				if(j==1 || funny[j].fi!=funny[j-1].fi) ptr=j;
				rnk[funny[j].se]=ptr;
			}
		}
	}
	auto p=manacher(s);
	for(int i=1; i<=2*n ;i++){
		funny[i]={rnk[i],i};
	}
	sort(funny+1,funny+2*n+1);
	ll ans=0;
	for(int i=2*n; i>=1 ;i--){
		int x=funny[i].se;
		//cout << "haha " << x << ' ';
		if(x>n) ans+=qry(2*n+1-x);
		else upd(x);
		//cout << ans << endl;
	}
	int cnt=0;/*
	for(int i=1; i<=n ;i++){
		for(int j=i; j<=n ;j++){
			if(rnk[i]>rnk[2*n+1-j]){
				cout << "! " << (++cnt) << ' ' << i << ' ' << j << endl;
			}
		}
	}*/
	{//deal with even false alarms
		for(int i=1; i<=n-1; i++){
			int ban=p[0][i];
			if(rnk[i+1]>rnk[2*n+1-i]){//prefix>suffix
				ans-=ban;
			}
		}
		for(int i=1; i<=n ;i++){
			int ban=p[1][i-1]+1;
			if(rnk[i]>rnk[2*n+1-i]){
				ans-=ban;
			}
		}
	}
	cout << ans << '\n';
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 7668kb

input:

jjikkollp

output:

4

result:

ok 1 number(s): "4"

Test #2:

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

input:

pbpbppb

output:

7

result:

ok 1 number(s): "7"

Test #3:

score: 0
Accepted
time: 560ms
memory: 13992kb

input:

tttbdckvkpisriwezmudlrwfkzxjtwrkhxmpqtfunhombmpqygpibgjvnyrjzvnkvwcsgtcdifujfqanmrvwkuxhgtntanazgeaermjdlrcbppwxsrdykkyxalfxsgjyktafbyrnlekwwbfsxbnwjfkkmwtcnytkbqqlfxxxfiomtsvyefkiojehqmvezcprdsxafpxjuvxcbwyjuugzcoszeuqzupgzwrykubltkeyiqdegtrtjxrjadqbngrktaflcatkuhofycrtxpaacfmtwmtheagxwynmibnrpwoej...

output:

9987275747

result:

ok 1 number(s): "9987275747"

Test #4:

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

input:

a

output:

0

result:

ok 1 number(s): "0"

Test #5:

score: 0
Accepted
time: 693ms
memory: 14988kb

input:

dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd...

output:

0

result:

ok 1 number(s): "0"

Test #6:

score: 0
Accepted
time: 445ms
memory: 14808kb

input:

cccccccccccccccccccccccccccccccccccccccccccccccccxcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccocccccccccccccccccccccccccccccccccccccccccccccxcccccccccccjcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc...

output:

10020572944

result:

ok 1 number(s): "10020572944"

Test #7:

score: 0
Accepted
time: 479ms
memory: 14912kb

input:

ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttjttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttetttttttttttttttttt...

output:

10270918647

result:

ok 1 number(s): "10270918647"

Test #8:

score: 0
Accepted
time: 213ms
memory: 9964kb

input:

ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooocoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo...

output:

2531342670

result:

ok 1 number(s): "2531342670"

Test #9:

score: 0
Accepted
time: 581ms
memory: 14988kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

0

result:

ok 1 number(s): "0"

Test #10:

score: 0
Accepted
time: 575ms
memory: 14256kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

0

result:

ok 1 number(s): "0"

Test #11:

score: 0
Accepted
time: 249ms
memory: 12976kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

0

result:

ok 1 number(s): "0"

Test #12:

score: 0
Accepted
time: 376ms
memory: 14152kb

input:

zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

output:

19230655235

result:

ok 1 number(s): "19230655235"

Test #13:

score: 0
Accepted
time: 390ms
memory: 14316kb

input:

zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

output:

19230527746

result:

ok 1 number(s): "19230527746"

Test #14:

score: 0
Accepted
time: 157ms
memory: 9840kb

input:

zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

output:

4807659003

result:

ok 1 number(s): "4807659003"

Test #15:

score: 0
Accepted
time: 502ms
memory: 14956kb

input:

aaaaaaaaaaeataagaaaaaaaaaaualapaaaaagaaaaaafamaaaaaaaalaaaaaaaaaaaaaiaapagaaaxaaaaaaaaaaiaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaafaaaayavayaaaiaiaaaoaaaaaaaeaaaaaauaaaaaaaaaaaauahayaaaaaaaaaaaaxaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaauaaaaaaaanaaanaaahaaaaaaaaaaaaaaaaaajaaanaaaaaaaaqaraaaaaaaaaaaaaaaaaaca...

output:

2289060770

result:

ok 1 number(s): "2289060770"

Test #16:

score: 0
Accepted
time: 455ms
memory: 14844kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

447195772

result:

ok 1 number(s): "447195772"

Test #17:

score: 0
Accepted
time: 184ms
memory: 12064kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaqaaaaaaaaaaaaaaaaaaaaaaaraaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

145781946

result:

ok 1 number(s): "145781946"

Test #18:

score: 0
Accepted
time: 468ms
memory: 14628kb

input:

zzzzzzzzzzzzuztzzzzzzzzzzwzzczzzzzczzzzzzzzzzzzwzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzgzzzzzizzzzzzlzzzzzzzzzzzzzzzzwzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzazzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzkzzzzizzzzzzzzzzzzzzzzzzmzzzzzzzzzzzzzzzzzzzzzzzzzzzezzzzzvzzzzzizzzzzzzzzzzzzzmzzzzfzrzzzzzbuzzzzzzzzzz...

output:

18409032362

result:

ok 1 number(s): "18409032362"

Test #19:

score: 0
Accepted
time: 377ms
memory: 14752kb

input:

zzzzgzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzwzzzzzgzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzdzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzezzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

output:

19438576443

result:

ok 1 number(s): "19438576443"

Test #20:

score: 0
Accepted
time: 204ms
memory: 13128kb

input:

zzzszzzznzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzmzzznzzzjzzzzpzwzzzzzzzzzzzzzzzzzzzzzzwzzzzzzzzzzzezzzzkzzzzzbzzzzzzzzzzzzzzzzzzzzzzzzzzzzzczzzzzzzzzzzfmzzczzzzsmzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjzzzzzzzzzzzzzzwzzzzzzzzzzuzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzvzzzzelz...

output:

4680731829

result:

ok 1 number(s): "4680731829"

Test #21:

score: 0
Accepted
time: 620ms
memory: 14340kb

input:

pacsknzvgzskpqcxdaivkhhkviadxcqpkszgvznkscappacsknzvgzskpqcxdaivkhhkviadxcqpkszgvznkscappacsknzvgzskpqcxdaivkhhkviadxcqpkszgvznkscappacsknzvgzskpqcxdaivkhhkviadxcqpkszgvznkscappacsknzvgzskpqcxdaivkhhkviadxcqpkszgvznkscappacsknzvgzskpqcxdaivkhhkviadxcqpkszgvznkscappacsknzvgzskpqcxdaivkhhkviadxcqpkszg...

output:

9973238297

result:

ok 1 number(s): "9973238297"

Test #22:

score: 0
Accepted
time: 626ms
memory: 14892kb

input:

oaeszxkfsyqlxiavjaehbvsyvfzunkknuzfvysvbheajvaixlqysfkxzseaooaeszxkfsyqlxiavjaehbvsyvfzunkknuzfvysvbheajvaixlqysfkxzseaooaeszxkfsyqlxiavjaehbvsyvfzunkknuzfvysvbheajvaixlqysfkxzseaooaeszxkfsyqlxiavjaehbvsyvfzunkknuzfvysvbheajvaixlqysfkxzseaooaeszxkfsyqlxiavjaehbvsyvfzunkknuzfvysvbheajvaixlqysfkxzseao...

output:

9973273540

result:

ok 1 number(s): "9973273540"

Test #23:

score: 0
Accepted
time: 282ms
memory: 12028kb

input:

zzqwejqiyypyawscjcbalvyjanyekkeynajyvlabcjcswaypyyiqjewqzzzzqwejqiyypyawscjcbalvyjanyekkeynajyvlabcjcswaypyyiqjewqzzzzqwejqiyypyawscjcbalvyjanyekkeynajyvlabcjcswaypyyiqjewqzzzzqwejqiyypyawscjcbalvyjanyekkeynajyvlabcjcswaypyyiqjewqzzzzqwejqiyypyawscjcbalvyjanyekkeynajyvlabcjcswaypyyiqjewqzzzzqwejqiyy...

output:

2486021051

result:

ok 1 number(s): "2486021051"

Test #24:

score: 0
Accepted
time: 444ms
memory: 14868kb

input:

cnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnccnnc...

output:

9439930932

result:

ok 1 number(s): "9439930932"

Test #25:

score: 0
Accepted
time: 554ms
memory: 14284kb

input:

oyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryooyrzddzryo...

output:

9704207014

result:

ok 1 number(s): "9704207014"

Test #26:

score: 0
Accepted
time: 251ms
memory: 9788kb

input:

tuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihuttuhivvihut...

output:

2431144645

result:

ok 1 number(s): "2431144645"

Test #27:

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

input:

ultejuinafygvtkglxcpwbwqonryoocxlvyraiisvmonhhkqwrnhtkwfwwoglvywbslptaspzyaaecemiprcithpmlobcxnajbhpmofqkelnknjtoqklrocwlkgtkzlvvpqrqjbxhevdhcdcadwmtkmimzpcbhynttydoyxjdlehnfsnuegnzwchipqbtgfutlasedxgpyprxbkghrkfnqwohhicjgrqyuvqsylxethjevtiofztjfhpmvjgmlixpvmprkizxglesjlohjzrarusfutrzbokqowzfdrxxwnu...

output:

25310346

result:

ok 1 number(s): "25310346"

Test #28:

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

input:

iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii...

output:

0

result:

ok 1 number(s): "0"

Test #29:

score: 0
Accepted
time: 17ms
memory: 5868kb

input:

nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnndnnnnnnnnnnnannnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnndnnnnnnnnnnnnn...

output:

25496433

result:

ok 1 number(s): "25496433"

Test #30:

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

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

0

result:

ok 1 number(s): "0"

Test #31:

score: 0
Accepted
time: 9ms
memory: 5856kb

input:

zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

output:

48074404

result:

ok 1 number(s): "48074404"

Test #32:

score: 0
Accepted
time: 17ms
memory: 8004kb

input:

aaaaaaaaaaaaagaaaaaaaaaaaaaaaaaaaeaagkaaakaqaaaaaaaaaaaaaaaaaaaaeaaaaaaaajaaaeaaaaaaaapaaaoaaaaalaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaauaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaiaaaaaaaaaasaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaaaaaaaawaaaaaaaaaaaaaaaaaaaaaaaaaaaaahaaaaaaaaaaauaaaaaaaaaaaaaaacaaaaaaauaa...

output:

2831203

result:

ok 1 number(s): "2831203"

Test #33:

score: 0
Accepted
time: 9ms
memory: 8112kb

input:

zzzzzzzzzzzzzzzyzzzzzzzzzzzzzzzzzzzzjzzzzzzzzzzzzzzzzzzzzzzzzzbzzzzzzuzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzozzzzzzzzzzzzzzzzzzzzzzzfzzzzzzzzzzzzzzzzuzzzzzzzzzzzzzzzzzzzzzazzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzqzzzzzzzzzzzzzizzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzvzzz...

output:

47656154

result:

ok 1 number(s): "47656154"

Test #34:

score: 0
Accepted
time: 22ms
memory: 5952kb

input:

dqeybhneaaggaaejsbukuihukkuhxxxxhukkuhiukubsjeaaggaaenhbyeqddqeybhneaaggaaejsbukuihukkuhxxxxhukkuhiukubsjeaaggaaenhbyeqddqeybhneaaggaaejsbukuihukkuhxxxxhukkuhiukubsjeaaggaaenhbyeqddqeybhneaaggaaejsbukuihukkuhxxxxhukkuhiukubsjeaaggaaenhbyeqddqeybhneaaggaaejsbukuihukkuhxxxxhukkuhiukubsjeaaggaaenhbyeqd...

output:

24694861

result:

ok 1 number(s): "24694861"

Test #35:

score: 0
Accepted
time: 14ms
memory: 7828kb

input:

xbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbxxbzzbx...

output:

24694646

result:

ok 1 number(s): "24694646"