結果
| 問題 |
No.570 3人兄弟(その1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-11-26 15:41:02 |
| 言語 | Kotlin (2.1.0) |
| 結果 |
AC
|
| 実行時間 | 360 ms / 2,000 ms |
| コード長 | 501 bytes |
| コンパイル時間 | 12,015 ms |
| コンパイル使用メモリ | 434,276 KB |
| 実行使用メモリ | 61,300 KB |
| 最終ジャッジ日時 | 2024-11-20 13:11:09 |
| 合計ジャッジ時間 | 13,267 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 |
コンパイルメッセージ
Main.kt:16:10: warning: parameter 'args' is never used
fun main(args: Array<String>){
^
ソースコード
import java.util.*
fun inputHeight(heightMap: MutableMap<String, Int>){
var input = Scanner(System. `in`)
heightMap["A"] = input.nextInt()
heightMap["B"] = input.nextInt()
heightMap["C"] = input.nextInt()
sort(heightMap)
}
fun sort(heightMap: MutableMap<String, Int>){
var mapKey = heightMap.toList().sortedBy{ (_, value) -> -value }.toMap()
mapKey.forEach{ println(it.key) }
}
fun main(args: Array<String>){
var heightMap: MutableMap<String, Int> = mutableMapOf()
inputHeight(heightMap)
}