結果

問題 No.846 メダル
ユーザー pekempeypekempey
提出日時 2019-07-25 04:33:42
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 333 ms / 2,000 ms
コード長 326 bytes
コンパイル時間 13,248 ms
コンパイル使用メモリ 432,832 KB
実行使用メモリ 57,032 KB
最終ジャッジ日時 2024-04-30 21:07:31
合計ジャッジ時間 22,173 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 325 ms
56,812 KB
testcase_01 AC 321 ms
56,812 KB
testcase_02 AC 323 ms
56,932 KB
testcase_03 AC 324 ms
56,940 KB
testcase_04 AC 323 ms
56,956 KB
testcase_05 AC 319 ms
56,980 KB
testcase_06 AC 333 ms
56,808 KB
testcase_07 AC 314 ms
56,948 KB
testcase_08 AC 321 ms
56,892 KB
testcase_09 AC 319 ms
57,020 KB
testcase_10 AC 315 ms
57,032 KB
testcase_11 AC 314 ms
56,972 KB
testcase_12 AC 317 ms
56,952 KB
testcase_13 AC 322 ms
56,940 KB
testcase_14 AC 323 ms
56,920 KB
testcase_15 AC 321 ms
56,956 KB
testcase_16 AC 322 ms
56,888 KB
testcase_17 AC 322 ms
57,020 KB
testcase_18 AC 324 ms
56,912 KB
testcase_19 AC 320 ms
57,008 KB
testcase_20 AC 324 ms
56,828 KB
testcase_21 AC 322 ms
56,796 KB
testcase_22 AC 318 ms
56,904 KB
testcase_23 AC 322 ms
56,808 KB
testcase_24 AC 323 ms
56,820 KB
testcase_25 AC 322 ms
56,872 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:3:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

fun readLongs(): List<Long> = readLine()!!.split(" ").map{it.toLong()}

fun main(args: Array<String>) {
  val (P, Q, R) = readLongs()
  val (A, B, C) = readLongs()
  val l = maxOf(P*(A-1), Q*(A+B-1), R*(A+B+C-1)) + 1
  val r = minOf(P*A, Q*(A+B), R*(A+B+C))
  if (l > r) {
    println(-1)
  } else {
    println("$l $r")
  }
}
0