結果

問題 No.1132 凸凹
ユーザー fukafukatanifukafukatani
提出日時 2021-06-24 23:56:49
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 1,008 ms / 2,000 ms
コード長 285 bytes
コンパイル時間 12,503 ms
コンパイル使用メモリ 253,252 KB
実行使用メモリ 63,336 KB
最終ジャッジ日時 2023-09-07 13:30:12
合計ジャッジ時間 43,176 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 968 ms
62,684 KB
testcase_01 AC 973 ms
62,816 KB
testcase_02 AC 982 ms
63,060 KB
testcase_03 AC 959 ms
62,812 KB
testcase_04 AC 963 ms
63,020 KB
testcase_05 AC 982 ms
63,336 KB
testcase_06 AC 969 ms
62,804 KB
testcase_07 AC 973 ms
62,856 KB
testcase_08 AC 974 ms
62,832 KB
testcase_09 AC 994 ms
63,336 KB
testcase_10 AC 985 ms
62,796 KB
testcase_11 AC 966 ms
62,704 KB
testcase_12 AC 966 ms
63,188 KB
testcase_13 AC 961 ms
63,000 KB
testcase_14 AC 962 ms
62,980 KB
testcase_15 AC 977 ms
62,780 KB
testcase_16 AC 999 ms
62,940 KB
testcase_17 AC 994 ms
62,812 KB
testcase_18 AC 979 ms
62,928 KB
testcase_19 AC 970 ms
62,880 KB
testcase_20 AC 990 ms
62,724 KB
testcase_21 AC 1,008 ms
62,796 KB
testcase_22 AC 1,005 ms
63,024 KB
testcase_23 AC 1,005 ms
63,276 KB
testcase_24 AC 1,008 ms
62,980 KB
testcase_25 AC 987 ms
62,848 KB
testcase_26 AC 979 ms
62,796 KB
testcase_27 AC 987 ms
62,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val a,b,c,d,p,q = sc.nextInt
  val h = (x: Int) => a * x * x * x + b * x * x + c * x + d
  val min_p = (p to q).minBy(h(_))
  val max_p = (p to q).maxBy(h(_))
  println(s"${h(max_p)} $max_p ${h(min_p)} $min_p")
}
0