For this Question: Given a string S. A string is called good if it is a prefix of string S. A string is called well if it is of even length and can be divided into two equal sub-strings of equal length. Find number of sub-strings which are both good and well.First line contains a string S.

Constraints
1<=|S|<=100000
String S can contain char (a-z, A-Z), or one digit integers (0-9).Print the answer.Sample Input
aacaacc

Sample Output
2

Explanation
aa, aacaac are two substrings

Sample Input
1111

Sample Output
2, I have written this Solution Code: #include<bits/stdc++.h>
using namespace std;
#define pu push_back
#define fi first
#define se second
#define mp make_pair
//#define int long long
#define sz 2000005
int z[sz];
signed main()
{
	string s;
	cin>>s;
	int n=s.size();
	int l=0,r=0;
	int no=0;
	
	for(int i=1;i<n;i++)
	{
		if(i<=r) z[i]=min(r-l+1,z[i-l]);
		
		while(i+z[i]<n && s[z[i]]==s[i+z[i]]) z[i]++;
		
		if(i+z[i]-1>r) r=i+z[i]-1,l=i;
		
		if(s[i]!='0' && z[i]>=i && i<=n/2) no++;
	}
	cout<<no<<endl;
	
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?