제출 #632530

#제출 시각아이디문제언어결과실행 시간메모리
632530tunardevPalindromes (APIO14_palindrome)C++14
0 / 100
1092 ms1124 KiB
#include <bits/stdc++.h>
using namespace std;

bool isReversed(string s) {
	string u = s;
	reverse(u.begin(), u.end());
	return u == s;
}

int main() {
	string s;
	cin >> s;

	int n = (int) s.length(), ans = 0;
	for (int i = 0; i < n; ++i) {
		string u = "";
		for (int j = 0; j < n; ++j) {
			u += s[j];
			if (isReversed(u)) {
				ans++;
			}
		}
	}

	if (isReversed(s)) {
		ans++;
	}

	cout << ans / 3 << "\n";
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...