結果
| 問題 | No.238 Mr. K's Another Gift |
| コンテスト | |
| ユーザー |
tnoda_
|
| 提出日時 | 2015-09-01 17:31:29 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
AC
|
| 実行時間 | 60 ms / 2,000 ms |
| + 355µs | |
| コード長 | 525 bytes |
| 記録 | |
| コンパイル時間 | 66 ms |
| コンパイル使用メモリ | 80,896 KB |
| 実行使用メモリ | 81,792 KB |
| 最終ジャッジ日時 | 2026-07-17 19:54:13 |
| 合計ジャッジ時間 | 4,946 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 40 |
ソースコード
def is_palindromic(s):
L = len(s)
for i in xrange(L/2):
if s[i] != s[L-1-i]:
return False
return True
S = raw_input()
L = len(S)
for i in xrange(L/2):
if S[i] != S[L-1-i]:
sol0 = S[:L-i] + S[i] + S[L-i:]
if is_palindromic(sol0):
print(sol0)
quit()
sol1 = S[:i] + S[L-1-i] + S[i:]
if is_palindromic(sol1):
print(sol1)
quit()
print('NA')
quit()
center = S[L/2]
print(S[:L/2] + center + S[L/2:])
tnoda_