結果

問題 No.604 誕生日のお小遣い
ユーザー 826814741_6826814741_6
提出日時 2019-01-07 12:20:55
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 308 ms / 1,000 ms
コード長 296 bytes
コンパイル時間 12,531 ms
コンパイル使用メモリ 428,992 KB
実行使用メモリ 56,928 KB
最終ジャッジ日時 2024-05-01 14:38:11
合計ジャッジ時間 19,224 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 295 ms
56,816 KB
testcase_01 AC 298 ms
56,892 KB
testcase_02 AC 296 ms
56,820 KB
testcase_03 AC 294 ms
56,884 KB
testcase_04 AC 308 ms
56,864 KB
testcase_05 AC 290 ms
56,812 KB
testcase_06 AC 294 ms
56,904 KB
testcase_07 AC 299 ms
56,764 KB
testcase_08 AC 291 ms
56,904 KB
testcase_09 AC 299 ms
56,792 KB
testcase_10 AC 304 ms
56,768 KB
testcase_11 AC 298 ms
56,928 KB
testcase_12 AC 305 ms
56,828 KB
testcase_13 AC 299 ms
56,760 KB
testcase_14 AC 302 ms
56,836 KB
testcase_15 AC 294 ms
56,888 KB
testcase_16 AC 298 ms
56,776 KB
testcase_17 AC 293 ms
56,896 KB
testcase_18 AC 296 ms
56,816 KB
testcase_19 AC 301 ms
56,868 KB
testcase_20 AC 295 ms
56,908 KB
testcase_21 AC 294 ms
56,800 KB
testcase_22 AC 295 ms
56,884 KB
testcase_23 AC 296 ms
56,908 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:10:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

fun f(a: Long, b: Long, c: Long): Long =
    when {
        a<=c -> {
            val d = a.dec()+b
            c/d*a + (if (c%d<a) c%d else a)
        }
        else -> c
    }

fun main(args: Array<String>) {
    val (a,b,c) = readLine()!!.split(' ').map(String::toLong)
    println(f(a,b,c))
}
0