結果
| 問題 |
No.39 桁の数字を入れ替え
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-05-11 01:57:16 |
| 言語 | Swift (6.0.3) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 429 bytes |
| コンパイル時間 | 792 ms |
| コンパイル使用メモリ | 126,440 KB |
| 実行使用メモリ | 8,960 KB |
| 最終ジャッジ日時 | 2024-11-30 14:06:58 |
| 合計ジャッジ時間 | 1,624 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 WA * 6 |
ソースコード
var input:[String] = readLine()!.map{String($0)}
var count = 0
for i in 0 ..< input.count {
var index:Int = 0
for j in i+1 ..< input.count {
if Int(input[i])! < Int(input[j])! {
index = j
}
}
if index != 0 {
let a = input[i]
input[i] = input[index]
input[index] = a
break
}
}
var output:String = ""
for c in input {
output += c
}
print(output)