結果
問題 | No.273 回文分解 |
ユーザー |
![]() |
提出日時 | 2021-12-06 16:25:29 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 39 ms / 2,000 ms |
コード長 | 348 bytes |
コンパイル時間 | 201 ms |
コンパイル使用メモリ | 82,252 KB |
実行使用メモリ | 61,568 KB |
最終ジャッジ日時 | 2024-07-07 09:21:57 |
合計ジャッジ時間 | 2,424 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 |
ソースコード
s = str(input()) def check(s): n = len(s) for i in range(n//2): if s[i] != s[n-1-i]: return False return True ans = 0 n = len(s) for i in range(n-1): for j in range(i+1, n+1): if i == 0 and j == n: continue t = s[i:j] if check(t): ans = max(ans, j-i) print(ans)