結果

問題 No.571 3人兄弟(その2)
ユーザー R_FR_F
提出日時 2017-11-28 13:54:57
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 355 ms / 2,000 ms
コード長 765 bytes
コンパイル時間 12,266 ms
コンパイル使用メモリ 423,980 KB
実行使用メモリ 60,092 KB
最終ジャッジ日時 2023-08-12 21:27:40
合計ジャッジ時間 18,754 ms
ジャッジサーバーID
(参考情報)
judge13 / judge9
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 346 ms
58,352 KB
testcase_01 AC 348 ms
58,272 KB
testcase_02 AC 346 ms
58,244 KB
testcase_03 AC 343 ms
58,152 KB
testcase_04 AC 350 ms
58,588 KB
testcase_05 AC 344 ms
58,376 KB
testcase_06 AC 350 ms
58,220 KB
testcase_07 AC 346 ms
58,216 KB
testcase_08 AC 347 ms
58,212 KB
testcase_09 AC 355 ms
58,004 KB
testcase_10 AC 344 ms
58,040 KB
testcase_11 AC 351 ms
60,092 KB
testcase_12 AC 345 ms
58,160 KB
testcase_13 AC 342 ms
58,040 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:18:10: warning: parameter 'args' is never used
fun main(args: Array<String>){
         ^

ソースコード

diff #

import java.util.Scanner

var input = Scanner(System. `in`)

fun inputHeightAndWeight(heightMap: MutableMap<String, IntArray>){
	heightMap["A"] = intArrayOf(input.nextInt(), input.nextInt())
	heightMap["B"] = intArrayOf(input.nextInt(), input.nextInt())
	heightMap["C"] = intArrayOf(input.nextInt(), input.nextInt())
	sort(heightMap)
}

fun sort(heightMap: MutableMap<String, IntArray>){
	var weightSort: Map<String, IntArray> = heightMap.toList().sortedBy{ (_, value) -> value[1] }.toMap()
	var heightSort: Map<String, IntArray> = weightSort.toList().sortedBy{ (_, value) -> -value[0] }.toMap()
	heightSort.forEach{ println(it.key) }
}

fun main(args: Array<String>){
	var heightMap: MutableMap<String, IntArray> = mutableMapOf()
	inputHeightAndWeight(heightMap)
}
0