結果

問題 No.729 文字swap
ユーザー reforefo2
提出日時 2020-05-07 16:05:28
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 369 bytes
コンパイル時間 70 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-03 09:25:58
合計ジャッジ時間 1,078 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
i, j = map(int,input().split())
result = []
if i < j:
    result.append(S[0:i])
    result.append(S[j])
    result.append(S[i+1:j])
    result.append(S[i])
    result.append(S[j+1:len(S)])
if i > j:
    result.append(S[0:j])
    result.append(S[i])
    result.append(S[j+1:i])
    result.append(S[j])
    result.append(S[i+1:len(S)])

print("".join(result))
0