結果

問題 No.39 桁の数字を入れ替え
ユーザー fusmafusma
提出日時 2020-05-20 15:36:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 289 bytes
コンパイル時間 159 ms
コンパイル使用メモリ 82,828 KB
実行使用メモリ 55,220 KB
最終ジャッジ日時 2024-04-09 22:58:16
合計ジャッジ時間 1,755 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
54,596 KB
testcase_01 AC 41 ms
54,116 KB
testcase_02 AC 40 ms
54,648 KB
testcase_03 AC 40 ms
54,408 KB
testcase_04 AC 40 ms
55,104 KB
testcase_05 AC 40 ms
53,744 KB
testcase_06 AC 40 ms
53,588 KB
testcase_07 AC 40 ms
54,416 KB
testcase_08 WA -
testcase_09 AC 40 ms
53,744 KB
testcase_10 AC 39 ms
53,616 KB
testcase_11 AC 40 ms
54,564 KB
testcase_12 AC 40 ms
55,220 KB
testcase_13 AC 41 ms
54,924 KB
testcase_14 AC 40 ms
54,352 KB
testcase_15 AC 40 ms
54,408 KB
testcase_16 AC 41 ms
54,692 KB
testcase_17 AC 41 ms
53,484 KB
testcase_18 AC 41 ms
54,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools,copy
N = [int(i) for i in list(input())]
C = itertools.combinations(range(len(N)),2)
ans = 0
for a,b in C:
    NewN = copy.deepcopy(N)
    NewN[a],NewN[b] = NewN[b],NewN[a]
    cur = 0
    for n in NewN:
        cur *= 10
        cur += n
    ans = max(cur,ans)
print(ans)
0