結果
| 問題 |
No.273 回文分解
|
| ユーザー |
matsu7874
|
| 提出日時 | 2015-08-28 22:43:38 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 31 ms / 2,000 ms |
| コード長 | 293 bytes |
| コンパイル時間 | 197 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2024-06-25 13:24:53 |
| 合計ジャッジ時間 | 2,180 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
ソースコード
def is_palindrome(s):
n = len(s)
if s == s[::-1]:
return True
else:
return False
S = input()
N = len(S)
for lenght in range(N - 1, 0, -1):
for i in range(N - lenght + 1):
if is_palindrome(S[i:i + lenght]):
print(lenght)
exit()
matsu7874