Submission #3505

# Submission time Handle Problem Language Result Execution time Memory
3505 2013-08-31T06:13:32 Z waps12b Make superpalindrome! (kriii1_M) C++
0 / 1
4 ms 2088 KB
#include<string>
#include<iostream>
using namespace std;



string make(string s){
	if(s.length() == 1)	return s;
	int len = s.length();
	for(int i=0;i<len/2;i++){
		char &l = s[i];
		char &r = s[len - i - 1];
		if(l < r)
			r = l ++;
		else if( l > r ){
			r = l;
		}
	}
	string ans = make(s.substr(0,len/2));
	if( len % 2 == 0)
		return ans + ans;
	else
		return ans + s[len/2] + ans;
}

int main(){
	string s;
	cin >> s ;
	cout << make(s);
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 2088 KB Output isn't correct
2 Halted 0 ms 0 KB -