結果
| 問題 | No.1132 凸凹 |
| ユーザー |
kokatsu
|
| 提出日時 | 2022-05-12 20:14:02 |
| 言語 | D (dmd 2.112.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 469 bytes |
| 記録 | |
| コンパイル時間 | 1,712 ms |
| コンパイル使用メモリ | 189,992 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2026-03-06 19:59:19 |
| 合計ジャッジ時間 | 2,620 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 26 |
コンパイルメッセージ
/home/linuxbrew/.linuxbrew/opt/dmd/include/dlang/dmd/core/checkedint.d(814): Warning: cannot inline function `core.checkedint.mulu!().mulu`
ulong mulu()(ulong x, uint y, ref bool overflow)
^
ソースコード
import std;
void main() {
long a, b, c, d, p, q;
readf("%d %d %d %d %d %d\n", a, b, c, d, p, q);
long M = long.min, m = long.max;
long XM, Xm;
foreach (x; p .. q+1) {
long x2 = x * x, x3 = x * x2;
long fx = a * x3 + b * x2 + c * x + d;
if (M < fx) {
M = fx;
XM = x;
}
if (m > fx) {
m = fx;
Xm = x;
}
}
writeln(M, " ", XM, " ", m, " ", Xm);
}
kokatsu