csu oj 1539 数学公式
来源:互联网 发布:网络平台贷款逾期 编辑:程序博客网 时间:2024/06/07 02:35
//csu oj 1539 space golf#include<iostream>#include<cstring>#include<cstdio>#include<cstdlib>#include<cmath>#define maxn 20000#define inf 0x3f3f3fusing namespace std;struct node{double x,y;}p[maxn];double Min(double a,double b){if(a>b) return b;else return a;}double Max(double a,double b){if(a>b) return a;elsereturn b;}int main(){int n,b;double d;while(scanf("%lf%d%d",&d,&n,&b)!=EOF){double m=inf;for(int i=1;i<=n;i++)scanf("%lf%lf",&p[i].x,&p[i].y);for(int j=0;j<=b;j++){double mi=0;double l=d/(double)(j+1);double miao=l/4.0; double tmp=sqrt((l*l/(8.0*miao))+2*miao);for(int i=1;i<=n;i++){int tmp=p[i].x/l;double xx=p[i].x-(double)tmp*l; double ans1=(xx-l/2.0)*(xx-l/2.0); ans1=(ans1*4.0)/(l*l); ans1=1-ans1; ans1=p[i].y/ans1;double temp=sqrt((l*l/(8.0*ans1))+2*ans1);mi=Max(ans1,mi);}mi=Max(mi,l/4.0);double res=sqrt((l*l/(8.0*mi))+2*mi);m=Min(m,res);}printf("%.6lf\n",m);}}
0 0
- csu oj 1539 数学公式
- CSU OJ 1216
- CSU oj 1685 Entertainment Box
- CSU oj 1322: ZZY‘s new company
- csu oj 1008 Horcrux(计数)
- csu oj 1010 Water Drinking(BFS)
- csu oj 1031 Real Numbers(模拟)
- [csu oj] 1548: Design road(三分)
- [csu oj]1553: Good subsequence(水题)
- csu oj K swap operation 模拟
- CSU OJ:1318 Small change(规律)
- CSU OJ:1255 斓少摘苹果(思维)
- CSU OJ 1505: 酷酷的单词
- 数学公式
- 数学公式
- 数学公式
- 数学公式
- 数学公式
- QWT6.1.2安装使用 Win8 64位 Qt5.3.1_MSVC2013
- STL之complex
- ZOJ 3299 线段树
- 欢迎使用CSDN-markdown编辑器
- java List 去重,list去除重复
- csu oj 1539 数学公式
- POJ - 2342 Anniversary party 树形DP
- 浅析MySQL中exists与in的使用
- jQuery Tmpl 基本用法
- Java非静态内部类为什么不能有静态成员
- java使用wordnet获取近义词
- Linux内核常用的一些宏的收集
- jeasyui.extensions.tree.js
- nginx通过TCP以及unix-domain-socket连接fastcgi方式对比