結果

問題 No.588 空白と回文
ユーザー KoshStorm
提出日時 2017-11-03 23:26:10
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 450 bytes
コンパイル時間 116 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 21,376 KB
最終ジャッジ日時 2024-11-23 14:55:00
合計ジャッジ時間 15,266 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13 WA * 8 TLE * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

S = list(input())
l = len(S) -1


def solve(i,j):
	global S
	count = 0
	while i <= j:
		#print("i:",i,"j:",j)
		if S[i] == S[j]:
			if i == j:
				count += 1
			else:
				count += 2
		i += 1
		j -= 1

	return count

prev_count = 0
for i in range(l):
	for j in range(i+1):
		if prev_count >= l - i:
			print(prev_count)
			exit(0)

		count = solve(i+j,l-j)

		#print("count:",count)

		if prev_count < count:
			prev_count = count



print(prev_count)
0