結果
| 問題 |
No.39 桁の数字を入れ替え
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-05-11 01:54:09 |
| 言語 | Swift (6.0.3) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 428 bytes |
| コンパイル時間 | 913 ms |
| コンパイル使用メモリ | 124,464 KB |
| 実行使用メモリ | 9,088 KB |
| 最終ジャッジ日時 | 2024-11-30 14:07:13 |
| 合計ジャッジ時間 | 1,777 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)