結果
問題 | No.1617 Palindrome Removal |
ユーザー |
|
提出日時 | 2021-07-22 21:52:32 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 456 bytes |
コンパイル時間 | 173 ms |
コンパイル使用メモリ | 82,468 KB |
実行使用メモリ | 78,840 KB |
最終ジャッジ日時 | 2024-07-17 17:26:43 |
合計ジャッジ時間 | 2,797 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 18 WA * 2 |
ソースコード
#!/usr/bin/env python3 # from typing import * def solve(s: str) -> int: if s != ''.join(reversed(s)): return len(s) if s == s[0] * len(s): if len(s) % 2 == 0: return 0 else: return -1 return len(s) - 2 # generated by oj-template v4.8.0 (https://github.com/online-judge-tools/template-generator) def main(): S = input() a = solve(S) print(a) if __name__ == '__main__': main()