結果
| 問題 | No.39 桁の数字を入れ替え |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-20 15:36:49 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 289 bytes |
| 記録 | |
| コンパイル時間 | 211 ms |
| コンパイル使用メモリ | 85,728 KB |
| 実行使用メモリ | 55,132 KB |
| 最終ジャッジ日時 | 2026-04-18 07:37:09 |
| 合計ジャッジ時間 | 1,860 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 WA * 1 |
ソースコード
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)