extle.dpr
来自「tongji acm-online judge solution」· DPR 代码 · 共 28 行
DPR
28 行
{$N+}
program Ural_1200(Input, Output);
type
TIndex = Integer;
TData = Extended;
var
tot, K, j, MaxHorn, MaxHoof: TIndex;
tmp, Max, PriceHorn, PriceHoof: TData;
begin
Readln(PriceHorn, PriceHoof);
Readln(K);
for tot := 1 to K do
for j := 0 to tot do
begin
tmp := j * PriceHorn + (tot - j) * PriceHoof - Sqr(j)
- Sqr(tot - j);
if tmp > Max then
begin
Max := tmp;
MaxHorn := j;
MaxHoof := tot - j;
end;
end;
Writeln(Max: 0: 2);
Writeln(MaxHorn, ' ', MaxHoof);
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?