結果
問題 |
No.1132 凸凹
|
ユーザー |
![]() |
提出日時 | 2025-03-20 20:18:13 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 37 ms / 2,000 ms |
コード長 | 523 bytes |
コンパイル時間 | 153 ms |
コンパイル使用メモリ | 82,404 KB |
実行使用メモリ | 54,028 KB |
最終ジャッジ日時 | 2025-03-20 20:19:16 |
合計ジャッジ時間 | 1,923 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 26 |
ソースコード
a, b, c, d, p, q = map(int, input().split()) max_val = None min_val = None x_max = p x_min = p for x in range(p, q + 1): current = a * x ** 3 + b * x ** 2 + c * x + d if max_val is None: # Initialization max_val = current min_val = current x_max = x x_min = x else: if current > max_val: max_val = current x_max = x if current < min_val: min_val = current x_min = x print(f"{max_val} {x_max} {min_val} {x_min}")