結果
| 問題 | No.238 Mr. K's Another Gift |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-11-17 07:09:31 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 32 ms / 2,000 ms |
| コード長 | 424 bytes |
| 記録 | |
| コンパイル時間 | 118 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 60,928 KB |
| 最終ジャッジ日時 | 2026-04-13 08:28:22 |
| 合計ジャッジ時間 | 3,968 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 40 |
ソースコード
s = input()
n = len(s)
if s == s[::-1]:
ans = s[:n // 2] + s[n // 2] + s[n // 2:]
print(ans)
exit()
for i in range(n):
if s[i] != s[n - i - 1]:
res = s[:i] + s[n - i - 1] + s[i:]
if res == res[::-1]:
print(res)
exit()
res = s[:n - i] + s[i] + s[n - i:]
if res == res[::-1]:
print(res)
exit()
print("NA")
exit()