結果

問題 No.750 Frac #1
ユーザー バカらっくバカらっく
提出日時 2022-02-14 10:32:05
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 339 ms / 1,000 ms
コード長 460 bytes
コンパイル時間 14,100 ms
コンパイル使用メモリ 420,196 KB
実行使用メモリ 57,212 KB
最終ジャッジ日時 2023-09-11 16:01:22
合計ジャッジ時間 24,876 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 295 ms
57,080 KB
testcase_01 AC 299 ms
57,044 KB
testcase_02 AC 298 ms
57,000 KB
testcase_03 AC 295 ms
57,028 KB
testcase_04 AC 297 ms
56,988 KB
testcase_05 AC 298 ms
57,040 KB
testcase_06 AC 292 ms
56,668 KB
testcase_07 AC 300 ms
56,832 KB
testcase_08 AC 285 ms
52,924 KB
testcase_09 AC 311 ms
57,096 KB
testcase_10 AC 304 ms
56,892 KB
testcase_11 AC 297 ms
56,812 KB
testcase_12 AC 301 ms
57,112 KB
testcase_13 AC 304 ms
56,700 KB
testcase_14 AC 299 ms
57,212 KB
testcase_15 AC 318 ms
52,940 KB
testcase_16 AC 303 ms
57,204 KB
testcase_17 AC 306 ms
56,884 KB
testcase_18 AC 296 ms
56,928 KB
testcase_19 AC 299 ms
56,892 KB
testcase_20 AC 296 ms
53,100 KB
testcase_21 AC 296 ms
57,112 KB
testcase_22 AC 299 ms
56,940 KB
testcase_23 AC 292 ms
56,932 KB
testcase_24 AC 334 ms
57,084 KB
testcase_25 AC 333 ms
57,000 KB
testcase_26 AC 331 ms
56,936 KB
testcase_27 AC 309 ms
56,852 KB
testcase_28 AC 292 ms
53,016 KB
testcase_29 AC 336 ms
57,012 KB
testcase_30 AC 306 ms
56,828 KB
testcase_31 AC 306 ms
56,820 KB
testcase_32 AC 339 ms
56,792 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val num = (1..n).map { readLine()!!.split(" ").map { it.toInt() }.let { Num(it[0], it[1]) } }.sortedDescending()
    num.forEach { println("${it.a} ${it.b}") }
}

class Num(val a:Int, val b:Int):Comparable<Num> {
    override fun compareTo(other: Num): Int {
        if(b == other.b) {
            return a.compareTo(other.a)
        }
        return (a*other.b).compareTo(other.a*b)
    }
}
0