結果

問題 No.39 桁の数字を入れ替え
ユーザー syunsukesyunsuke
提出日時 2020-09-19 10:49:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 94 ms / 5,000 ms
コード長 268 bytes
コンパイル時間 719 ms
コンパイル使用メモリ 86,504 KB
実行使用メモリ 71,504 KB
最終ジャッジ日時 2023-09-05 12:20:54
合計ジャッジ時間 3,519 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
71,348 KB
testcase_01 AC 87 ms
71,352 KB
testcase_02 AC 88 ms
71,380 KB
testcase_03 AC 89 ms
71,180 KB
testcase_04 AC 91 ms
71,380 KB
testcase_05 AC 92 ms
71,428 KB
testcase_06 AC 92 ms
71,152 KB
testcase_07 AC 92 ms
71,344 KB
testcase_08 AC 90 ms
71,248 KB
testcase_09 AC 90 ms
71,360 KB
testcase_10 AC 93 ms
71,184 KB
testcase_11 AC 92 ms
71,344 KB
testcase_12 AC 91 ms
71,252 KB
testcase_13 AC 92 ms
71,504 KB
testcase_14 AC 91 ms
71,384 KB
testcase_15 AC 91 ms
71,380 KB
testcase_16 AC 90 ms
71,264 KB
testcase_17 AC 94 ms
71,300 KB
testcase_18 AC 92 ms
71,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=input()

L=[]
for i in range(len(N)):
    L.append(N[i])
#print(L)

ans=[L]
import copy
for i in range(len(N)):
    for j in range(i+1,len(N)):
        A=copy.deepcopy(L)
        A[i],A[j]=A[j],A[i]
        ans.append(A)
ans.sort(reverse=True)
print("".join(ans[0]))
0