結果

問題 No.604 誕生日のお小遣い
ユーザー 💕💖💞💕💖💞
提出日時 2018-02-16 03:02:27
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 330 ms / 1,000 ms
コード長 257 bytes
コンパイル時間 12,297 ms
コンパイル使用メモリ 428,848 KB
実行使用メモリ 60,392 KB
最終ジャッジ日時 2024-05-01 14:32:59
合計ジャッジ時間 21,300 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 315 ms
60,224 KB
testcase_01 AC 317 ms
60,284 KB
testcase_02 AC 314 ms
60,196 KB
testcase_03 AC 315 ms
60,332 KB
testcase_04 AC 318 ms
60,284 KB
testcase_05 AC 316 ms
60,288 KB
testcase_06 AC 312 ms
60,348 KB
testcase_07 AC 318 ms
60,160 KB
testcase_08 AC 320 ms
60,356 KB
testcase_09 AC 315 ms
60,268 KB
testcase_10 AC 315 ms
60,172 KB
testcase_11 AC 319 ms
60,312 KB
testcase_12 AC 316 ms
60,276 KB
testcase_13 AC 330 ms
60,392 KB
testcase_14 AC 319 ms
60,308 KB
testcase_15 AC 319 ms
60,264 KB
testcase_16 AC 323 ms
60,188 KB
testcase_17 AC 318 ms
60,308 KB
testcase_18 AC 320 ms
60,240 KB
testcase_19 AC 320 ms
60,256 KB
testcase_20 AC 317 ms
60,224 KB
testcase_21 AC 320 ms
60,368 KB
testcase_22 AC 325 ms
60,176 KB
testcase_23 AC 320 ms
60,228 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args:Array<String>) {
         ^
Main.kt:6:74: warning: unnecessary non-null assertion (!!) on a non-null receiver of type Long
  val last = listOf(cycle, obj - (obj/batch)*(cycle + income - 1) ).min()!!
                                                                         ^

ソースコード

diff #

fun main(args:Array<String>) {
  val (cycle, income, obj) = readLine()!!.split(" ").map { it.toLong() }

  val batch = income + cycle - 1
  
  val last = listOf(cycle, obj - (obj/batch)*(cycle + income - 1) ).min()!!
  println( cycle*(obj/batch) + last ) 
}
0