結果
| 問題 |
No.39 桁の数字を入れ替え
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-20 15:36:49 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 289 bytes |
| コンパイル時間 | 1,265 ms |
| コンパイル使用メモリ | 82,140 KB |
| 実行使用メモリ | 53,888 KB |
| 最終ジャッジ日時 | 2024-10-01 23:34:59 |
| 合計ジャッジ時間 | 2,425 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)