結果

問題 No.863 計算量
ユーザー バカらっくバカらっく
提出日時 2019-08-24 18:15:06
言語 Kotlin
(1.9.10)
結果
AC  
実行時間 276 ms / 1,000 ms
コード長 354 bytes
コンパイル時間 11,127 ms
コンパイル使用メモリ 417,124 KB
実行使用メモリ 50,188 KB
最終ジャッジ日時 2023-08-13 02:57:21
合計ジャッジ時間 17,050 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 276 ms
49,988 KB
testcase_01 AC 265 ms
49,952 KB
testcase_02 AC 267 ms
49,908 KB
testcase_03 AC 270 ms
50,064 KB
testcase_04 AC 266 ms
49,980 KB
testcase_05 AC 268 ms
49,976 KB
testcase_06 AC 270 ms
49,944 KB
testcase_07 AC 259 ms
49,984 KB
testcase_08 AC 263 ms
50,188 KB
testcase_09 AC 264 ms
49,992 KB
testcase_10 AC 262 ms
50,152 KB
testcase_11 AC 261 ms
49,888 KB
testcase_12 AC 265 ms
50,048 KB
testcase_13 AC 264 ms
50,004 KB
testcase_14 AC 262 ms
50,120 KB
testcase_15 AC 269 ms
49,976 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:3:10: warning: parameter 'args' is never used
fun main(args: Array<String>){
         ^

ソースコード

diff #

import kotlin.math.abs

fun main(args: Array<String>){
    val mul1 = 200000L / 5000
    val mul2 = (200000L * 200000L) / (5000L * 5000L)

    val num1 = readLine()!!.toLong()
    val num2 = readLine()!!.toLong()

    val diff1 = abs(num2 - (num1*mul1))
    val diff2 = abs(num2 - (num1*mul2))
    val ans = if(diff1 < diff2) 1 else 2
    println(ans)
}
0