POJ 3737】的更多相关文章

题目链接[http://poj.org/problem?id=3737] 题意:给出一个圆锥的表面积,求最大的体积,并输出最大体积的时候的圆锥的高度和底面积. 方法一: 根据定理:圆锥的表面积一定的时候,当圆锥的斜边长度是底边半径三倍的时候,圆锥的体积最大. #include<cmath> #include<cstdio> const double PI = acos(-1.0); int main () { double s,h,r,v; while(~scanf("%…
第一道三分题,有模板 #define eps 10e-6 double cal(){}//计算题目所需要的值 while(l+eps<r) { m1=l+(r-l)/3; m2=r-(r-l)/3; v1=cal(m1); v2=cal(m2); if(v1<v2)l=m1; else r=m2; } 感觉三分像是数学题,因为它求的是单峰极值的问题. #include <iostream> #include <cmath> #include <cstdio>…
[SInGuLaRiTy-1025] Copyrights (c) SinGuLaRiTy 2017. All Rights Reserved. [POJ 1905] 棍的膨胀 (Expanding Rods) 题目描述 已知一根长为L的细棍被加热了n摄氏度,那么其新的长度为L'=(1+n*C)*L.中间的C是热膨胀系数.当一根细棍被夹在两面墙中间然后被加热,它会膨胀,其形状会变成一个弧,而原来的细棍(加热前的细棍)就是这个弧所对的弦.你的任务是计算出弧的中点与弦的中点的距离. 输入 包含多组数…
题目链接 题意 : 给你若干个点,让你找最小的正方形覆盖这所有的点.输出面积. 思路 : 三分枚举正方形两对边的距离,然后求出最大,本题用的是旋转正方形,也可以用旋转点,即点的相对位置不变. 正方形从0度到180度变化的过程中,把所有点覆盖,面积肯定是有一个最小峰值,是一个凸函数.因此可以用三分法解决.这里有一个难点就是已知两个定点的x,y坐标,过这两个点做两条平行线,平行线并与x轴成d度的角,怎么算出两条平行线的距离. d1 = fabs(cos(d)*(yi-yj)-sin(d)*(xi-x…
Crossing River Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 9887   Accepted: 3737 Description A group of N people wishes to go across a river with only one boat, which can at most carry two persons. Therefore some sort of shuttle arra…
Halloween treats Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 7644   Accepted: 2798   Special Judge Description Every year there is the same problem at Halloween: Each neighbour is only willing to give a certain total number of sweets…
Find a multiple Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7192   Accepted: 3138   Special Judge Description The input contains N natural (i.e. positive integer) numbers ( N <= 10000 ). Each of that numbers is not greater than 15000…
The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 22286   Accepted: 8603   Special Judge Description The game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a…
Flip Game Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 37427   Accepted: 16288 Description Flip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and the…
Corn Fields Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 9806   Accepted: 5185 Description Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yumm…