結果

問題 No.604 誕生日のお小遣い
ユーザー 826814741_6826814741_6
提出日時 2019-01-07 12:20:55
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 259 ms / 1,000 ms
コード長 296 bytes
コンパイル時間 15,377 ms
コンパイル使用メモリ 414,848 KB
実行使用メモリ 55,032 KB
最終ジャッジ日時 2023-08-14 01:34:36
合計ジャッジ時間 17,732 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 243 ms
53,024 KB
testcase_01 AC 250 ms
52,940 KB
testcase_02 AC 246 ms
52,776 KB
testcase_03 AC 254 ms
52,944 KB
testcase_04 AC 259 ms
52,720 KB
testcase_05 AC 247 ms
52,856 KB
testcase_06 AC 245 ms
52,744 KB
testcase_07 AC 240 ms
52,772 KB
testcase_08 AC 243 ms
52,788 KB
testcase_09 AC 241 ms
52,732 KB
testcase_10 AC 250 ms
52,972 KB
testcase_11 AC 242 ms
55,032 KB
testcase_12 AC 244 ms
52,976 KB
testcase_13 AC 242 ms
53,152 KB
testcase_14 AC 246 ms
52,856 KB
testcase_15 AC 246 ms
53,000 KB
testcase_16 AC 247 ms
52,804 KB
testcase_17 AC 249 ms
53,032 KB
testcase_18 AC 250 ms
53,052 KB
testcase_19 AC 243 ms
52,824 KB
testcase_20 AC 244 ms
53,016 KB
testcase_21 AC 246 ms
52,804 KB
testcase_22 AC 244 ms
52,984 KB
testcase_23 AC 243 ms
52,896 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