QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#523069#7364. 回文369Pai0 463ms195320kbC++207.6kb2024-08-17 19:30:012024-08-17 19:30:02

Judging History

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

  • [2024-08-17 19:30:02]
  • 评测
  • 测评结果:0
  • 用时:463ms
  • 内存:195320kb
  • [2024-08-17 19:30:01]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e6 + 10 , Q = 5e5 + 10 , T = 21 * N , C = 26;
int n , m , q , len[N] , id[N] , rt[Q] , ans[Q]; 
struct Query{int l , r , id;}qu[Q] , tmp[Q];
vector<int>pos[C];
string t; char s[N];
class fastIO{private:char ibuf[50007],*p1=ibuf,*p2=ibuf,obuf[50007],*p3=obuf,sta[50];bool file_end=false;char get(){return p1==p2&&(p2=(p1=ibuf)+fread(ibuf,1,50007,stdin),p1==p2)?(file_end=true),char(EOF):*p1++;}void put(const char x){p3-obuf<50007?*p3++=x:(fwrite(obuf,p3-obuf,1,stdout),p3=obuf,*p3++=x);}public:explicit operator bool(){return!file_end;}size_t flush(){size_t f=fwrite(obuf,p3-obuf,1,stdout);p3=obuf;*p3=0;return f;}fastIO&operator>>(char&t){for(t=get();!isgraph(t);t=get());return*this;}template<typename any>typename std::enable_if<std::is_same<any,char>::value,any>::type tpval(){char t;for(t=get();!isgraph(t);t=get());return t;}fastIO&operator>>(char*t){char c;for(c=get();!isgraph(c);c=get());for(;isgraph(c);c=get())*t=c,t++;*t=0;return*this;}fastIO&operator>>(std::string&t){t.clear();char c;for(c=get();!isgraph(c);c=get());for(;isgraph(c);c=get())t+=c;return*this;}template<typename any>typename std::enable_if<std::is_same<any,std::string>::value,any>::type tpval(){std::string t;char c;for(c=get();!isgraph(c);c=get());for(;isgraph(c);c=get())t+=c;return t;}template<typename any>typename std::enable_if<(std::is_signed<any>::value&&std::is_integral<any>::value&&!std::is_same<any,char>::value)||std::is_same<any,__int128_t>::value,fastIO>::type&operator>>(any&t){t=0;bool y=0;char c=get();for(;!isdigit(c);c=get())if(c==45)y=true;for(;isdigit(c);c=get())t=t*10+c-48;if(y==1)t=-t;return*this;}template<typename any>typename std::enable_if<(std::is_signed<any>::value&&std::is_integral<any>::value&&!std::is_same<any,char>::value)||std::is_same<any,__int128_t>::value,any>::type tpval(){any t=0;bool y=0;char c=get();for(;!isdigit(c);c=get())if(c==45)y=true;for(;isdigit(c);c=get())t=t*10+c-48;if(y==1)t=-t;return t;}template<typename any>typename std::enable_if<(std::is_unsigned<any>::value&&std::is_integral<any>::value&&!std::is_same<any,char>::value)||std::is_same<any,__uint128_t>::value,fastIO>::type&operator>>(any&t){t=0;char c=get();for(;!isdigit(c);c=get());for(;isdigit(c);c=get())t=t*10+c-48;return*this;}template<typename any>typename std::enable_if<(std::is_unsigned<any>::value&&std::is_integral<any>::value&&!std::is_same<any,char>::value)||std::is_same<any,__uint128_t>::value,any>::type tpval(){any t=0;char c=get();for(;!isdigit(c);c=get());for(;isdigit(c);c=get())t=t*10+c-48;return t;}template<typename any1,typename any2>fastIO&operator>>(std::pair<any1,any2>&t){return*this>>t.first>>t.second;}template<typename any1,typename any2>std::pair<any1,any2>tpval(){return std::pair<any1,any2>(tpval<any1>(),tpval<any2>());}template<typename any>fastIO&read(any&t){return*this>>t;}fastIO&read(char*t){char c;for(c=get();!isgraph(c);c=get());for(;isgraph(c);c=get())*t=c,t++;*t=0;return*this;}template<typename any,typename...args>fastIO&read(any&t1,args&...t2){return(*this>>t1).read(t2...);}fastIO&operator<<(const char t){put(t);return*this;}fastIO&operator<<(const char*t){for(;*t;t++)put(*t);return*this;}fastIO&operator<<(const std::string&t){for(const char it:t)put(it);return*this;}template<typename any>typename std::enable_if<(std::is_signed<any>::value&&std::is_integral<any>::value&&!std::is_same<any,char>::value)||std::is_same<any,__int128_t>::value,fastIO>::type&operator<<(any t){if(!t){put(48);return*this;}int len=0;if(t<0)t=-t,put(45);while(t)sta[len++]=char(t%10+48),t/=10;while(len--)put(sta[len]);return*this;}template<typename any>typename std::enable_if<(std::is_unsigned<any>::value&&std::is_integral<any>::value&&!std::is_same<any,char>::value)||std::is_same<any,__uint128_t>::value,fastIO>::type&operator<<(any t){if(!t){put(48);return*this;}int len=0;while(t)sta[len++]=char(t%10+48),t/=10;while(len--)put(sta[len]);return*this;}template<typename any1,typename any2>fastIO&operator<<(const std::pair<any1,any2>&t){return*this<<t.first<<' '<<t.second;}template<typename any>fastIO&write(const any&t){return*this<<t;}template<typename any,typename...args>fastIO&write(const any&t1,const args&...t2){return(*this<<t1).write(t2...);}~fastIO(){fwrite(obuf,p3-obuf,1,stdout);}}fio;
struct Segtree
{
	int tot;
	struct Node{int lc , rc;}tr[T];
	#define lc(p) (tr[p].lc)
	#define rc(p) (tr[p].rc)
	int update(int s , int p , int l = 1 , int r = n)
	{
		int q = ++tot;
		tr[q] = tr[p];
		if(l == r)return q;
		int mid = (l + r) >> 1;
		if(s <= mid)lc(q) = update(s , lc(p) , l , mid);
		else rc(q) = update(s , rc(p) , mid + 1 , r);
		return q;
	}
	bool query(int s , int e , int p , int l = 1 , int r = n)
	{
		if(!p || (s <= l && r <= e))return p;
		int mid = (l + r) >> 1;
		if(s <= mid){if(query(s , e , lc(p) , l , mid))return 1;}
		if(mid < e){if(query(s , e , rc(p) , mid + 1 , r))return 1;}
		return 0;
	}
}sgt;
void Calc(int l , int r , int ql , int qr)
{
	if(l > r || ql > qr)return ;
	// cerr << "Calc " << l << ',' << r << " " << ql << ',' << qr << "\n";
	if(l == r)
	{
		for(int i = ql ; i <= qr ; i++)
		{
			auto [x , y , id] = qu[i];
			ans[id] = l;
		}
		return ;
	}
	int mid = (l + r + 1) >> 1 , hd = ql , tl = qr;
	// cerr << "  mid = " << mid << "\n";
	for(int i = ql ; i <= qr ; i++)
	{
		auto [x , y , id] = qu[i];
		int L = x + mid - 1 , R = y - mid + 1;
		// cerr << "\t(" << x << ',' << y << ' ' << id << "): [" << L << ',' << R << "]" << (L > R ? 0 : sgt.query(L , R , rt[mid])) << "\n";
		if(L > R || !sgt.query(L , R , rt[mid]))
			tmp[hd++] = qu[i];
		else tmp[tl--] = qu[i];
	}
	for(int i = ql ; i <= qr ; i++)qu[i] = tmp[i];
	Calc(l , mid - 1 , ql , hd - 1);
	Calc(mid , r , tl + 1 , qr);
}
signed main()
{
	fio >> t >> q; n = t.size();
	if(count(t.begin() , t.end() , 'a') == n)
	{
		for(int i = 1 ; i <= q ; i++)
		{
			int l , r; fio >> l >> r;
			fio << r - l + 1 << "\n";
		}
		return 0;
	}
	for(int i = 1 ; i <= n ; i++)
		pos[t[i - 1] - 'a'].push_back(i);
	for(int i = 1 ; i <= n * 2 ; i += 2)
		s[i] = '#' , s[i + 1] = t[i / 2];
	s[n = n * 2 + 1] = '#';
	int L = n , R = 1;
	for(int i = 1 ; i <= q ; i++)
	{
		int l , r; fio >> l >> r;
		char ch = t[l - 1];
		if(ch == t[r - 1])
		{
			vector<int>&vc = pos[ch - 'a'];
			auto il = lower_bound(vc.begin() , vc.end() , l);
			auto ir = upper_bound(vc.begin() , vc.end() , r);
			if(ir - il == r - l + 1)
				ans[i] = r - l + 1;
		}
		if(!ans[i])
		{
			qu[++m] = {l * 2 - 1 , r * 2 + 1 , i};
			L = min(l * 2 - 1 , L);
			R = max(R , r * 2 + 1);
		}
	}
	if(m)
	{
		for(int i = 1 , l = 0 , r = 0 ; i <= n ; i++)
		{
			if(l <= i && i <= r)
				len[i] = min(r - i , len[l + r - i]);
			while(i - len[i] > 1 && i + len[i] < n && s[i - len[i] - 1] == s[i + len[i] + 1])
				len[i]++;
			if(i + len[i] > r)l = i - len[i] , r = i + len[i];
		}
		// for(int i = 1 ; i <= n ; i++)cerr << s[i];
		// cerr << "\n";
		// for(int i = 1 ; i <= n ; i++)cerr << len[i] << " \n"[i == n];
		for(int i = 1 ; i <= R - L + 1 ; i++)id[i] = L + i - 1;
		sort(id + 1 , id + (R - L + 1) + 1 , [&](int x , int y){return len[x] > len[y];});
		int md = len[id[1]] + 1;
		for(int i = md , j = 1 ; i >= 0 ; i--)
		{
			rt[i] = rt[i + 1];
			for(; j <= R - L + 1 && len[id[j]] >= i ; j++)
				rt[i] = sgt.update(id[j] , rt[i]);
			// cerr << "d = " << i << ":";
			// for(int j = 1 ; j <= n ; j++)cerr << sgt.query(j , j , rt[i]) << " \n"[j == n];
		}
		// auto t1 = chrono::steady_clock::now();
		Calc(0 , md , 1 , m);
		// auto t2 = chrono::steady_clock::now();
		// cerr << (t2 - t1) / 1ms << "ms\n";
	}
	for(int i = 1 ; i <= q ; i++)
		fio << ans[i] << "\n";
	return 0;
}

詳細信息


Pretests


Final Tests

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 9936kb

input:

kmojliclywcyevunhgfnumdzvncnmzbkxjsrkzlyguvjwqmyamvwvidqvfcwnkoolupcrjhynrnlmncqwntqaqtnwqcnmlnrnyhjrcpulooknwcfvqdivwvmaymqwjvugylzkrsmlabbmjltopjasklgawfdbosdlmwahaygutogtvoenkxddmehwokwybkpireouiqqlsfbuqslxjlusnwkzgadxtagewjlchtcezugeguzecthcljwegatxdagzkwnsuljxlsqwlkpvoajknflirxpqcxmyhcgimr
293
...

output:

101
76
84
64
3
2
101
3
3
3
40
3
1
42
3
24
2
1
63
46
2
63
32
1
101
84
3
42
14
63
63
4
2
2
3
1
2
1
1
3
2
63
24
16
16
101
2
32
63
72
101
50
38
2
101
101
3
72
1
63
3
32
86
1
2
63
101
2
3
3
63
3
64
66
63
3
101
63
42
3
3
4
74
8
1
26
63
38
30
18
1
3
3
2
3
101
1
101
1
4
3
63
1
1
32
78
101
90
32
42
101
16
60...

result:

wrong answer 2nd lines differ - expected: '75', found: '76'

Test #2:

score: 0
Wrong Answer
time: 2ms
memory: 9880kb

input:

vesjaxxsumewkbahmdfohuzggavsskdplrjqgonwnvtqhqdvxwdvbbvdwxtostthmmzqckepyglcysblxcbcxlbsyclgylyqtthedcqvuoghiyfekmaycoiiumirusuzosmaijqpgrwgcnxtojzyxpnjzyzjnpxyzjotxncgwrgpqjiamsozusurimuiiocyamkefyihgouvpxqdkybihtpmfqfzlwzylmtpgzvzhcrygruvzztttbofobtttzzvurgyrchzvzgptmlyzwlzfqfmpthibykdqxpegpbglnzk...

output:

82
101
72
50
42
60
101
82
87
101
3
21
101
21
101
101
44
101
60
64
24
20
14
101
26
101
21
76
101
28
3
56
101
28
10
24
88
21
24
40
68
1
3
21
101
21
101
4
3
1
56
10
52
8
101
21
36
2
62
42
16
78
21
10
101
90
101
101
1
5
101
3
101
2
101
101
101
48
3
1
3
101
3
60
3
24
101
1
21
101
101
101
1
20
101
1
3
101...

result:

wrong answer 1st lines differ - expected: '81', found: '82'

Test #3:

score: 0
Wrong Answer
time: 5ms
memory: 13240kb

input:

anuahqplebjsacgumhxqolpgrxqcqzlhxrdthilfysevwdukoaksysixdggqzfjifopilugpdlrihgriaedgcjljuzdyqnyplpovdlvsitjcizogkcjkipzwnbdugpkkcghcpcioksqbnvfeggpzdfcxddppanaqnjdrtczcurvgdhnhuuxmktusuykwqrpjgauznlzcgxahiumnbeendsvdoflmuqaylnmsxgfdelfljnvlkeftwsvqhrxpnyjfwohdomcrqcxhvfvksfkjaihqiksfwdlopmwyhagelhju...

output:

5
1272
595
118
5
5
1666
5
1666
957
1666
5
1439
1666
1666
4
545
259
929
1666
3
5
3
669
5
1666
3
797
1666
4
1666
5
1666
3
1272
1666
747
1272
1666
863
437
591
290
1666
765
577
4
1507
5
1272
1327
639
5
1666
1272
5
3
1666
1065
607
165
753
1272
5
4
1666
805
1666
5
1272
3
5
1666
3
1666
81
5
4
5
1272
299
16...

result:

wrong answer 3rd lines differ - expected: '594', found: '595'

Test #4:

score: 0
Wrong Answer
time: 5ms
memory: 12876kb

input:

mfvckuykhckfuqmontrmfcfttxsqnaenocsvdxafpwkpftcwtqwgtsihvaquaudwebxmdijlcrenvivcwbwccmjyxmgmuhdkesgmkcbasghbbwlutayipathsvawcdkkmbdkdiurfsytgjasgsrebgtyjlclkycanipjqlpvxtusmetaxpkwvgilcqnspilinqanxofgxjwqzphraildqdewozyndxbekdknrvbdjgwwvulxfdaqpsziqmrtvlzcabcnouwilynyrbzktbfsfaepmyfjbwuuhvxihiyjicox...

output:

3
1194
698
129
858
3
698
904
5
1665
698
698
94
390
698
625
698
3
3
1665
4
3
1240
436
766
1665
77
538
1665
5
698
5
3
179
625
698
394
698
698
698
3
107
317
1034
652
625
714
1665
698
402
698
1306
1032
5
1098
3
1352
625
120
1394
698
3
625
5
195
698
698
698
322
625
3
422
698
3
698
698
748
1665
886
5
28
6...

result:

wrong answer 2nd lines differ - expected: '1193', found: '1194'

Test #5:

score: 0
Wrong Answer
time: 0ms
memory: 11036kb

input:

piliegnejflgljiidtifmgpcwttkfqexweatzcfecoyuyzpyayapbnenfvjbimyuttkjimtuzpoyhfugdivlxyebblrvgkwowzftkjxjopepbcdkcrioyjjscqnvycmaicuijcdkzizgtyskrkgyflmfvtntfnuikjqyblajyhygopbgpmxruwkkkuqszuuxhorfzsyzgpnxcuifrlvieeeavsrrgthetamjemxekupmclxitasqoqrokhtvomrjlksomhagdxyarqqoqhzuiqlhinhizujhkziqnabxnguz...

output:

4
96
1667
3
1667
1
791
791
604
3
3
1408
96
3
4
1667
584
4
320
758
1667
1320
791
564
726
1667
791
902
1667
1222
791
182
1667
1667
1667
1564
5
291
96
180
120
3
1046
4
1250
846
1667
1667
1667
754
96
10
1667
182
291
96
182
791
206
96
182
264
1667
1667
528
291
1446
1667
1667
1667
1
1667
791
282
291
1667
...

result:

wrong answer 9th lines differ - expected: '603', found: '604'

Test #6:

score: 0
Wrong Answer
time: 0ms
memory: 12620kb

input:

syucmgkigdlpevdxsshewqirqqcdljqjgaugkvzplmidhvwxeuhuzmzscczopnaviqlgnavpezpquyupilccvjsqfxjmpcsefwerqlgfitezkaffvdwlyhilzflbjecsikzvyecgpjkucqukkrauolgzffotznjxmbvcmsuzrwstehxgqzygfjfybzmyuoxvshelxlpzfxwalgxzlwvhsbaikzsgjkzvzjmlbhgubzcunksleqdgulmysfjashpwjymspmtoxiwaiimcbdqbbudlwbptrusyumtszzwbpmgg...

output:

495
495
3
7
741
741
1541
1541
495
741
1232
188
7
5
741
5
741
1222
741
552
495
1541
495
741
1541
1052
741
495
1230
741
495
1541
1082
690
1541
278
1260
4
386
4
495
4
495
741
4
806
7
1094
548
741
4
844
741
741
741
7
1404
7
5
452
7
7
495
741
741
372
4
7
400
741
741
282
495
495
3
1541
4
3
4
741
578
4
3
1...

result:

wrong answer 11th lines differ - expected: '1231', found: '1232'

Test #7:

score: 0
Wrong Answer
time: 16ms
memory: 26040kb

input:

acfojkhxkvgskemxswoddjrxylgurlpfkpkhssmaqavonpjkhozprsffoslcluvabbpmynaucitshgbfrhilbxuyvdeilculqepksnsosdruqnzkrismdmpypuwigcwmlrynryysiazxaikbsvsxhwobtxuriupwxfmotimszqrfqqcfcukzmghijkeibpndndbodgzpuzqyznrjpzykhzmgrcxhexbsjmanfybqvojzbwpyttmrneejcpdncuzcjdmgxevqmbltpkotcywnfglumjpldxytuaahbgdcnges...

output:

5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
5770
...

result:

wrong answer 1st lines differ - expected: '5769', found: '5770'

Test #8:

score: 0
Wrong Answer
time: 38ms
memory: 27264kb

input:

aaxvxlcltrlilgqvklenrxdcqzouiizataquwymdxtkzyenpdefayzmwugrysrxpwznxpesvcglwqokoajclkeiadelfupalmwhpceexzuzethlcuidgwekhrzvacntvtfmlqptdszlphlewmmwzwcdmjwpefntdlcdrrhejjhakjpkglpbyooqkdhkzrswpmlseuqobyzrquhtdqlbfegkolncwaqoyxrmelvysykpsschwcghzecwneoklalscjqgxoqilbisabofjebktbbzomfupjqcupolpowbtazlq...

output:

3298
12041
5
7
11678
1438
12041
5
88
14910
140
5
9
12041
15140
1158
5
12041
14914
12744
16665
7
16665
12041
5
3
7
5402
7
16665
16665
12041
8960
12041
5
5
11760
12041
7314
16665
12041
16665
4496
2954
11106
16665
7856
8512
12041
2954
1352
14140
2954
12041
16665
5
6634
4972
13328
7
2954
16474
5
16665
1...

result:

wrong answer 1st lines differ - expected: '3297', found: '3298'

Test #9:

score: 0
Wrong Answer
time: 36ms
memory: 28284kb

input:

bydjourdrgeaxhanforissxtcbtoqpcslsmsuipplgpyitlspqplflboqptqnahqwzchrjhifexlgnmbsehwkwjzojfwvhmmuatwkozdvqwxcorhmhirdgzkztmzegneseslmxuuoifnakuwsycrcgkzpnspyvvfrcbutiknycrvsqgglsvritrrmilxhhrtclxzslysblwsimexxkodgizphdapogypdudlssdispudgxhnfidsyivbvgamsujzzelovuilauyzmstgpgqipmhnbqskffrjjfnzhotbnlzk...

output:

10656
5
9092
6
16665
7
9296
12693
6
6
16665
16665
6
5010
2039
752
12693
12693
2188
7342
6
16665
8432
12693
3688
7
12693
16665
7472
7
7
9288
12693
12693
4786
4786
12693
16665
4786
16665
3186
16665
10382
6
4786
12693
12280
2476
7
5
12693
3924
12693
6
4786
888
5426
5
6
16665
12693
11704
4682
4786
16665...

result:

wrong answer 1st lines differ - expected: '10655', found: '10656'

Test #10:

score: 0
Wrong Answer
time: 31ms
memory: 26036kb

input:

hsfcfbhlqerzkkwsyslalaslnahwpqqhkflavreluedfhcprzyfaipqyzaupdypfannefsdhimxnxoxbaqfktuqcgkjhskocyzeyyvbimybpixxgygccyqjcysqsylrhqrblfqrvheoolimkvqejywdjeuzbhhqdafuybfkarmacprqkqadbrfsrehhthtginqqhwdukdzjfrtgyepxmrnpmrokehpzxtnbigekjlvwkeofqrayiodxshtdbiisdyrboacqktisjtdkfuzmuzrmhgdqewukdcufjrqtskxjk...

output:

10617
8341
978
13845
6131
152
978
978
7183
7
9921
8062
5
152
12439
7
11895
5
978
152
5511
6385
5
7172
16664
5
1357
978
5
16664
13083
978
7868
6079
5
5
5
16664
152
11517
5
11357
16664
7
5
14121
13923
2551
2264
5
3864
978
8341
14293
7
1146
4
5
6341
8341
4
5
13623
5
16664
8341
152
16664
3187
978
5
5
11...

result:

wrong answer 1st lines differ - expected: '10616', found: '10617'

Test #11:

score: 0
Wrong Answer
time: 33ms
memory: 27352kb

input:

uqgylihdxuhtoedyzgzsnwjfaxxdrbadecbkxhbwvzztggrcvorlbgdobvnlswamdnehzepqdqeajrhfwkavapzqvbivztnsqtqnjxjejpgokdyyfxrsuxblzpftwbdkxvrczcerpjadlkqxieyslegpwgwuvzixavdbbtzcvuvnyjpjqvzfzcdnypukljhlspedodczoamlqokdljxdwtonfavmwxemmwicpfbcxfriiqymwizfjghzskzsxyzpluyjwvwyjjzjdddhoflaizakyjzmjmucfxrowqmiiiqp...

output:

5371
6
6
3
10495
14091
3
5
9805
2463
5
17758
5
17758
17758
17758
6686
12531
17758
16621
5
5
13895
301
5
17758
17758
17758
12583
15747
6686
5
1635
17758
1263
12773
5
5
5
979
17758
4
5
17758
493
12487
17758
5
7247
5
5
17758
5
5
1787
5
5
5
2529
17758
5
2059
5725
389
5
841
17758
6686
5
5
5
17758
17758
1...

result:

wrong answer 1st lines differ - expected: '5370', found: '5371'

Test #12:

score: 0
Wrong Answer
time: 28ms
memory: 28264kb

input:

senpfhuxjnjduvkehgshpecrhtmrsjqaeosajatkkrtdwodqmsfmvoxyipcqjddyxbrroqpkhujinzclqudwqhehxvbpsdqnxzhkjoipcqkqddetmordwjpsuqzoerllzmzbwuorrbmwbzjoycmpeyotbhcwdxygeeqgxbwcqlrywyruatywmmvgckvaowvjpeegwhzarnabqopxpkbtrkhyqauthnzkdmmfdxxfawxygtuzmmbdzhxhstkgtjgzaprjstmssfpczmyyqryfxycoimzobpbihnnmsocfegkc...

output:

5
7
8597
12105
5
7
7
5
7
5
13535
7569
2651
5
5
22963
7
4
5
8623
7
5
11327
5
5
7
5
3643
16369
5
7
7635
15869
7
10217
5
7
7
7
7
7
11443
5
385
23391
5
22921
24996
5
7
6483
8237
11561
5
7
7
6
7
6443
7
6
7
5
7
4281
7
5
685
13157
5
3003
5
7
7
7
14065
5
5
5
5419
5
14087
2901
5
5
7
7115
5
19689
8099
5
5
192...

result:

wrong answer 3rd lines differ - expected: '8596', found: '8597'

Test #13:

score: 0
Wrong Answer
time: 20ms
memory: 26588kb

input:

nwsiebavjnlnjifvaylnhfzybafysczcmrzplqehpgkavzaddjbltazcotufbdzxetxrwhshlxgoqdvbwrkeqkhsbujudbcjhahwkbluvnvdvdxnwocvdkjilwcziqdivzvdlbfwzdenmqlienvoqveubtdoszndqutfsguooniomoyblyxteyhpwommzvnumpwmzqafvfgmnokjwwnkdofoikamvlrxrfkvmrxmsrknmojvaumkrsrlgnpriipbnsbqvglegyhjdefpjngwtbknuivlyftjlsxgffnsjvib...

output:

5
2502
5830
2502
10753
2502
10753
759
9948
3991
2502
2502
4988
2502
10753
3724
10753
3490
759
7
10753
5
5830
5830
7
5
5830
7518
7
5830
2502
5
2429
10753
10753
10753
2502
10753
10753
2502
834
7300
5
6372
2502
5
10753
10753
5
2
5830
5
10753
6892
10753
5
7
5830
10753
10753
5482
5
2502
3015
8620
2502
25...

result:

wrong answer 9th lines differ - expected: '9947', found: '9948'

Test #14:

score: 0
Wrong Answer
time: 29ms
memory: 24868kb

input:

uoqxubtwiuvrweemnisntsggdzuataqgegovblspuctnszgscxridxjlgibfbtdetqrhkfzzvbkbufeisycazjudefsyvgraenfjynszhdjtzidepogsvltustouvnviyrdsncubobnlkruzcsxsabwayfldakyslzfprixpbgpzlfneokxjtnmgtwipkddbmmeahowhndbnuymxryrkgolobkenugcpyfcelqpnpwwphnufpjcxwjyxlcsutfogqlepvyfcjohvhqivjefwtkwubjgtlsabqnpdpixgnrvw...

output:

5
5
1763
5
5271
1430
104
6191
3087
3087
6147
5
3087
3087
3087
4422
3087
1614
5
5
5
4
5
3087
3087
6266
5271
5271
3087
5271
3258
104
5
104
1366
5
3087
3087
5
3087
7
3087
4405
2088
17
3087
3087
3087
5
5271
6125
5
5
5271
3087
3087
3087
5271
5
4
5271
5
5271
3087
3087
4670
4
3087
1740
4
104
2088
3722
3087...

result:

wrong answer 3rd lines differ - expected: '1762', found: '1763'

Test #15:

score: 0
Wrong Answer
time: 430ms
memory: 194068kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaakkeiauuzvxheynhjstrlmdjuyadlukikotjzhqkfxlyabcfwkdyqkgsrkeqcpingbwuhlvlqcwrnotohwdcteumlrepoccfdfznrdltjbjkjzqkdiglyqxwbukxvlivpbhdtzdxsiaqyoqsykspneectkcrlupikmvnqqtbvicmjgwzonahfpytentjnwqunjlpalkwpcskwlqcarzzlktnklalcmplozonpmfpysuyqviwslsfhnzcbplzhyhs...

output:

6416
87366
63380
101788
32697
51104
112675
68004
32697
15240
112675
112675
113202
112675
32697
6
131991
112675
131991
131991
112675
81804
16621
112675
7922
32697
44196
9
23037
7
7
32293
68004
112675
68004
131991
131991
78276
131991
7
6
112675
53844
112675
112675
112675
32697
32697
89750
22392
131991...

result:

wrong answer 1st lines differ - expected: '6415', found: '6416'

Test #16:

score: 0
Wrong Answer
time: 398ms
memory: 195164kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaytvhrajhtxhttnnlmeqimzzsjscccivbyritmiznnvgksdehrtmiwacnbixkxnjytuzimzssogvxaemlcpkdtimzfxqreghsbnsqpkwcfepbisgnmispquhyzeqapvpjdfjelclvezqsdjxndhuwxloghiljexxirocvfcpgrilpxspmzjkvhyifkptzguxohzyyjuxqahbblayluiktzmrsgrhthdypkigvjqngfuwkchfepqfvhyuyunfrhluvcdyhvbpktdfoyy...

output:

1180
166667
37262
91053
161108
60812
26966
166667
91053
134752
5
7
92134
7
25523
5888
91053
91053
91053
9451
1810
8
8
138552
91053
7
9451
26966
109628
8
8171
91053
26966
8
139412
91053
26966
112670
26978
95390
4482
12707
7
7
166667
91053
91053
141688
7
136180
9451
7
7
15759
239
19320
1180
46694
1666...

result:

wrong answer 3rd lines differ - expected: '37261', found: '37262'

Test #17:

score: 0
Wrong Answer
time: 438ms
memory: 194188kb

input:

aaaazkvsgnabokhungreeglngwrtynocgzehwlqgkiiiqdloxdezdcdbhriugyqfqhhaproemijuhymtacrerxmwdzzputjzucaygdskcwpvxdvuafnpfttarbksdowftsieylqlmpcvyrvhtdorechiduhgxkicaicbrcploefuuzmucorweejnscoepoijalirxzxrxbkksvuimwavmhxhhwndfkwocguaojzgtpxwtjmlrkbpbwvjtcilnyjjkmymvwaylhgmobosditopkpmmsawqlricifwcnwvxqac...

output:

7
108750
4
108750
25989
1744
45891
157572
102273
24333
29727
46691
84933
97702
69077
10621
24875
7
1744
7
88259
108750
8
12189
6
157572
65205
63345
20777
63341
81077
1744
33465
108750
9
118779
4651
8
8
133529
8
132561
66665
13255
108750
157572
7
137211
140695
117627
79789
77819
105379
97702
7
97702
...

result:

wrong answer 5th lines differ - expected: '25988', found: '25989'

Test #18:

score: 0
Wrong Answer
time: 463ms
memory: 195320kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaebhhrvkfkvewwgcwzupqagltrbvbpsmrzhqqrzpphdatdovtqcskottjjaijncilycjoqvhjbvaorrczwefumogmkipliwrjgjcmcksniyjpowbzpezlmkkiivhadolbahzjlelwurmdhfktndmcqndtbimufcsilykijsbmlqrxlfkimnzghkxgtqgznzgcgmrkygvzbdizbraghkncugpszudehqyuhkywdzdbitixbamapwgzbzknwypluul...

output:

166667
166667
7
34770
7
166667
24820
76850
166667
46450
48106
108562
4533
86704
46254
149298
7
7
68288
27050
166667
44129
166667
6
112092
64756
166667
7
7
162110
44129
7
32988
146666
166667
5
7
7
142778
7
4533
47364
7
7
7
163334
161804
7
52178
166667
73872
119294
166667
7
35456
7
22302
7
30600
67518...

result:

wrong answer 4th lines differ - expected: '34769', found: '34770'

Test #19:

score: 0
Wrong Answer
time: 457ms
memory: 194100kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalvgbspddxrtwkccxskalmiaahvuaaevjkzxskmumnesqsjfqlgkanmmdinkbiabnrmvocequrnicjqzdatwwdzpgyoumwymnsjnklvbjrswytpqejlgxcmoaqqvpihlghjrsyvcoxhvprkfusafjsdrgopnfufkoopyqetppxuciqcwjxldgtwcthdepfcxdvrrhxcxdmsjnukgpdgkknnwzwmtavzvynhsapujivwmjlsaybeuaftemhzpmuexavqmhvpfou...

output:

21968
106291
111779
8
132222
34381
30545
138938
30545
47966
61242
165948
63750
99509
13662
6
166667
30545
166667
6315
158618
7
151114
166667
132222
132222
7
96227
5
5
30545
132456
30979
132222
6
166667
28296
132542
86887
30545
8
7
46689
8
166667
30545
30545
113062
30545
166667
13698
7
7
132222
42147...

result:

wrong answer 1st lines differ - expected: '21967', found: '21968'

Test #20:

score: 0
Wrong Answer
time: 440ms
memory: 194672kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaairvzomrstpfklvpyiboqxtnqbjazhstswwhmrdgbzsstvkrtencmmeqjfclkztnlsrrghcfrfrivxfrrpnwehishsneqljlmqwkugitnkuotmncikpvxzvgxcvdppekdbomsvqupgpjdcowzqfoxcivupvucxstsjlrlylvlzmqcxtqdwztpxmzetubgxllckejlkwjytrvdwmimdencuffcdifrllsoihxnbhoyy...

output:

7
5
7
133041
6062
55837
133041
55837
7
55837
61642
53010
5
30554
133041
133041
115562
133041
132638
7
133041
55837
44822
1541
133041
133041
1552
6
1541
64618
33702
5
4014
132120
6
133041
1541
44822
44822
36612
55837
133041
90092
133041
1541
1541
1541
9
2512
133041
133041
83000
6
133041
7
55837
5
133...

result:

wrong answer 5th lines differ - expected: '6061', found: '6062'