結果

問題 No.238 Mr. K's Another Gift
コンテスト
ユーザー pluto77
提出日時 2019-11-23 11:02:48
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 247 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 306 ms
コンパイル使用メモリ 77,572 KB
最終ジャッジ日時 2025-12-04 01:59:33
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 40
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#yuki238

s=raw_input()
n=len(s)
for i in range(n/2):
 if s[i]!=s[n-i-1]:
  t=s[:n-i]+s[i]+s[n-i:]
  u=s[:i]+s[n-i-1]+s[i:]
  if t==t[::-1]:
   print t
  elif u==u[::-1]:
   print u
  else:
   print'NA'
  break
else:
 print s[:n/2]+s[n/2]+s[n/2:]
0