結果

問題 No.128 お年玉(1)
ユーザー yo-kondoyo-kondo
提出日時 2018-03-25 21:17:50
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 302 ms / 5,000 ms
コード長 502 bytes
コンパイル時間 13,152 ms
コンパイル使用メモリ 428,864 KB
実行使用メモリ 51,876 KB
最終ジャッジ日時 2024-04-08 19:29:55
合計ジャッジ時間 18,267 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 277 ms
51,780 KB
testcase_01 AC 283 ms
51,772 KB
testcase_02 AC 299 ms
51,788 KB
testcase_03 AC 302 ms
51,876 KB
testcase_04 AC 288 ms
51,772 KB
testcase_05 AC 287 ms
51,772 KB
testcase_06 AC 293 ms
51,768 KB
testcase_07 AC 292 ms
51,780 KB
testcase_08 AC 299 ms
51,784 KB
testcase_09 AC 284 ms
51,780 KB
testcase_10 AC 284 ms
51,784 KB
testcase_11 AC 279 ms
51,792 KB
testcase_12 AC 277 ms
51,776 KB
testcase_13 AC 285 ms
51,784 KB
testcase_14 AC 283 ms
51,772 KB
testcase_15 AC 280 ms
51,784 KB
testcase_16 AC 281 ms
51,776 KB
testcase_17 AC 276 ms
51,764 KB
testcase_18 AC 274 ms
51,772 KB
testcase_19 AC 287 ms
51,780 KB
testcase_20 AC 277 ms
51,784 KB
testcase_21 AC 278 ms
51,784 KB
testcase_22 AC 277 ms
51,772 KB
testcase_23 AC 293 ms
51,784 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:6:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

package yukicoder.no128

/**
 * エントリポイント
 */
fun main(args: Array<String>) {
    val in1 = readLine()
    val in2 = readLine()
    print(otoshidama(in1, in2))
}

/**
 * お年玉を均等に渡せる金額を返します。
 * @param budget 予算
 * @param num お年玉を渡す人数
 */
fun otoshidama(budget: String?, num: String?): String {
    if (budget == null || num == null) {
        return ""
    }
    return ((budget.toLong() / (num.toInt() * 1000)) * 1000).toString()
}
0