結果
問題 |
No.1617 Palindrome Removal
|
ユーザー |
![]() |
提出日時 | 2022-02-03 14:01:27 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 461 bytes |
コンパイル時間 | 192 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 145,432 KB |
最終ジャッジ日時 | 2024-06-11 09:54:13 |
合計ジャッジ時間 | 7,282 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 4 |
other | TLE * 1 -- * 19 |
ソースコード
from collections import deque s = deque(map(str,input())) ans = len(s) flag = True while(1): if(ans > 1): for i in range(ans//2): if(s[i] != s[ans-1-i]): flag = False break if(flag): s.pop() s.pop() ans -= 2 else: print(ans) exit(0) elif(ans == 1): print(-1) exit(0) else: print(0) exit(0)