結果

問題 No.477 MVP
ユーザー htkbhtkb
提出日時 2017-02-01 22:12:39
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 330 ms / 1,000 ms
コード長 299 bytes
コンパイル時間 12,188 ms
コンパイル使用メモリ 413,152 KB
実行使用メモリ 54,040 KB
最終ジャッジ日時 2023-08-12 17:22:24
合計ジャッジ時間 17,398 ms
ジャッジサーバーID
(参考情報)
judge11 / judge7
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 323 ms
53,672 KB
testcase_01 AC 324 ms
53,728 KB
testcase_02 AC 328 ms
53,588 KB
testcase_03 AC 324 ms
53,684 KB
testcase_04 AC 326 ms
53,524 KB
testcase_05 AC 324 ms
54,040 KB
testcase_06 AC 320 ms
53,952 KB
testcase_07 AC 325 ms
54,028 KB
testcase_08 AC 324 ms
53,784 KB
testcase_09 AC 321 ms
53,532 KB
testcase_10 AC 325 ms
53,720 KB
testcase_11 AC 330 ms
53,912 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:4:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^
Main.kt:7:13: warning: 'divide(BigDecimal!, Int): BigDecimal!' is deprecated. Deprecated in Java
    hp = hp.divide(BigDecimal(sc.next()).plus(BigDecimal("1")), BigDecimal.ROUND_FLOOR).plus(BigDecimal("1"))
            ^
Main.kt:7:76: warning: 'ROUND_FLOOR: Int' is deprecated. Deprecated in Java
    hp = hp.divide(BigDecimal(sc.next()).plus(BigDecimal("1")), BigDecimal.ROUND_FLOOR).plus(BigDecimal("1"))
                                                                           ^

ソースコード

diff #

import java.math.BigDecimal
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    var hp:BigDecimal = BigDecimal(sc.next());
    hp = hp.divide(BigDecimal(sc.next()).plus(BigDecimal("1")), BigDecimal.ROUND_FLOOR).plus(BigDecimal("1"))
    println(hp.toString())
}
0