結果
問題 |
No.273 回文分解
|
ユーザー |
|
提出日時 | 2025-03-11 23:30:11 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 802 bytes |
コンパイル時間 | 253 ms |
コンパイル使用メモリ | 12,032 KB |
実行使用メモリ | 10,368 KB |
最終ジャッジ日時 | 2025-03-11 23:30:15 |
合計ジャッジ時間 | 2,677 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | AC * 9 WA * 23 |
ソースコード
def main(): inp = input() num = [] count = 0 ans = 1 length = len(inp) for i in inp: wid = ans while length - count >= wid: if wid % 2 == 0: if inp[count : count + wid // 2] == inp[count + wid -1 : count + wid //2 - 1 : -1]: ans = wid wid += 1 else: wid += 1 else: if inp[count : count + wid // 2 ] == inp[count + wid - 1 : count + wid // 2 : -1]: ans = wid wid += 1 else: wid += 1 count += 1 if length >= 3: ans = 1 print(ans) if __name__ == '__main__': main()