結果

問題 No.588 空白と回文
ユーザー KoshStormKoshStorm
提出日時 2017-11-03 23:26:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 450 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 16,000 KB
最終ジャッジ日時 2024-05-02 20:37:17
合計ジャッジ時間 3,912 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
16,000 KB
testcase_01 AC 27 ms
10,624 KB
testcase_02 AC 26 ms
10,752 KB
testcase_03 AC 28 ms
10,624 KB
testcase_04 AC 26 ms
10,752 KB
testcase_05 WA -
testcase_06 AC 31 ms
10,624 KB
testcase_07 AC 25 ms
10,624 KB
testcase_08 AC 26 ms
10,624 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 25 ms
10,752 KB
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます

ソースコード

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