bzoj 1024 暴力深搜
2024-10-18 21:20:40
我们直接暴力的深搜怎么切就行了,
每一刀切的方案只有横着和竖着,横竖又分在几等分点切,
因为要保证每个人的面积相同,所以比较好处理了,第几个几等分点就
分给这边几刀。
/**************************************************************
Problem:
User: BLADEVIL
Language: Pascal
Result: Accepted
Time: ms
Memory: kb
****************************************************************/
//By BLADEVIL
var
x, y :extended;
n :longint;
function max(a,b:extended):extended;
begin
if a>b then max:=a else max:=b;
end;
function min(a,b:extended):extended;
begin
if a>b then min:=b else min:=a;
end;
function dfs(x,y:extended;n:longint):extended;
var
ans, r :extended;
i :longint;
begin
if x>y then
begin
ans:=x; x:=y; y:=ans;
end;
if n= then exit(y/x);
r:=/n; ans:=1e20;
for i:= to n- do
begin
ans:=min(ans,max(dfs(x*r*i,y,i),dfs(x-x*r*i,y,n-i)));
ans:=min(ans,max(dfs(x,y*i*r,i),dfs(x,y-y*r*i,n-i)));
end;
exit(ans);
end;
begin
read(x,y,n);
writeln(dfs(x,y,n)::);
end.
最新文章
- Request Entity Too Large for Self Hosted ASP.Net Web API在Selfhost的api后台怎么解决Request Entity Too Large问题
- 智能车学习(十三)——角度控制
- 获取 Cookie
- Dynamic CRM 2013学习笔记(二十七)无代码 复制/克隆方法
- java之对象转型2
- [HDOJ5933]ArcSoft's Office Rearrangement(贪心)
- Centos7安装Zabbix3.0
- perf
- 条形码Code128源代码
- 淘宝的ip地址库
- 解决MySQL连接超时Communications link failure due to underlying exception
- hdu 3047 Zjnu Stadium
- vue.js的devtools安装
- 实现在Android 多点手势识别
- [移动端] IOS下border-image不起作用的解决办法
- WPF 自定义ItemsControl/ListBox/ListView控件样式
- mysql批量导出单结构与结构数据表脚本
- windows下启动mysql服务
- 既然还看不到未来之光,那就从骄阳开始的地方--IT携行
- ALGO-123_蓝桥杯_算法训练_A+B problem