結果

問題 No.39 桁の数字を入れ替え
ユーザー あかりきあかりき
提出日時 2021-02-08 09:58:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 92 ms / 5,000 ms
コード長 220 bytes
コンパイル時間 1,248 ms
コンパイル使用メモリ 86,848 KB
実行使用メモリ 71,620 KB
最終ジャッジ日時 2023-09-18 15:43:06
合計ジャッジ時間 4,258 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
71,340 KB
testcase_01 AC 89 ms
71,360 KB
testcase_02 AC 90 ms
71,464 KB
testcase_03 AC 89 ms
71,556 KB
testcase_04 AC 89 ms
71,468 KB
testcase_05 AC 88 ms
71,520 KB
testcase_06 AC 89 ms
71,548 KB
testcase_07 AC 92 ms
71,380 KB
testcase_08 AC 91 ms
71,376 KB
testcase_09 AC 91 ms
71,292 KB
testcase_10 AC 90 ms
71,584 KB
testcase_11 AC 88 ms
71,540 KB
testcase_12 AC 87 ms
71,436 KB
testcase_13 AC 87 ms
71,488 KB
testcase_14 AC 87 ms
71,460 KB
testcase_15 AC 91 ms
71,620 KB
testcase_16 AC 89 ms
71,388 KB
testcase_17 AC 87 ms
71,548 KB
testcase_18 AC 87 ms
71,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import copy
n=list(input())
ans=[]
ans.append(int(''.join(n)))
for i in range(len(n)):
  for j in range(len(n)):
    l=copy.copy(n)
    if i!=j:
      l[i],l[j]=l[j],l[i]
      ans.append(int(''.join(l)))
print(max(ans))
0