結果
| 問題 | No.39 桁の数字を入れ替え |
| コンテスト | |
| ユーザー |
Konton7
|
| 提出日時 | 2019-04-28 10:59:29 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 31 ms / 5,000 ms |
| コード長 | 448 bytes |
| 記録 | |
| コンパイル時間 | 364 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-12-15 06:30:38 |
| 合計ジャッジ時間 | 1,621 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
import math
import copy
s = list(input())
ls = len(s)
def swap(a,b,c):
x = copy.deepcopy(c)
x[a], x[b] = x[b], x[a]
return x
swplist = [ [ (i,j) for j in range(i+1,ls) ] for i in range(ls)]
stringlist = ["".join(s)]
for i in range(len(swplist)):
for j in range(len(swplist[i])):
b, e = swplist[i][j][0], swplist[i][j][1]
stringlist.append("".join(swap(b,e,s)))
anslist = sorted(stringlist)
print(anslist[-1])
Konton7