結果
| 問題 |
No.588 空白と回文
|
| コンテスト | |
| ユーザー |
KoshStorm
|
| 提出日時 | 2017-11-04 00:00:22 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 442 bytes |
| コンパイル時間 | 217 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 21,120 KB |
| 最終ジャッジ日時 | 2024-11-23 15:17:01 |
| 合計ジャッジ時間 | 15,354 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 WA * 8 TLE * 4 |
ソースコード
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-1):
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(1)
KoshStorm