FZU 1077 铁皮容器 【枚举/二分】
Accept: 1040 Submit: 2314
Time Limit: 1000 mSec Memory Limit :
32768 KB
Problem Description
Input
(1<=k<=10),表示测试例的个数。后面紧接着k行,每行对应一个测试例,含一个整数n(0<=n<=20000),代表容积。
Output
Sample Input
1000
3000
Sample Output
NO
Source
FJNU Preliminary 2005
#include <iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<streambuf>
#include<cmath>
#include<string>
using namespace std;
#define ll long long
#define oo 10000000
#define PI acos(-1.0)
int main()
{
int t,n,v;
double r;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
r=1e-; //1e-6就TLE了
while()
{
v=*r-PI*r*r*r;
if(v==n)
{
printf("%.1f\n",r);
break;
}
if(r>=)
{
printf("NO\n");
break;
}
r+=1e-; //枚举
}
}
}
枚举
FZU 1077 铁皮容器 【枚举/二分】的更多相关文章
- HDU4430 Yukari's Birthday(枚举+二分)
Yukari's Birthday HDU4430 就是枚举+二分: 注意处理怎样判断溢出...(因为题目只要10^12) 先前还以为要用到快速幂和等比数列的快速求和(但肯定会超__int64) 而 ...
- CSU OJ PID=1514: Packs 超大背包问题,折半枚举+二分查找。
1514: Packs Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 61 Solved: 4[Submit][Status][Web Board] ...
- 4 Values whose Sum is 0(枚举+二分)
The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute ...
- Codeforces Round #379 (Div. 2) C. Anton and Making Potions 枚举+二分
C. Anton and Making Potions 题目连接: http://codeforces.com/contest/734/problem/C Description Anton is p ...
- HDU 4282 A very hard mathematic problem --枚举+二分(或不加)
题意:问方程X^Z + Y^Z + XYZ = K (X<Y,Z>1)有多少个正整数解 (K<2^31) 解法:看K不大,而且不难看出 Z<=30, X<=sqrt(K) ...
- Subset---poj3977(折半枚举+二分查找)
题目链接:http://poj.org/problem?id=3977 给你n个数,找到一个子集,使得这个子集的和的绝对值是最小的,如果有多种情况,输出子集个数最少的: n<=35,|a[i]| ...
- hdu 5288 OO’s Sequence 枚举+二分
Problem Description OO has got a array A of size n ,defined a function f(l,r) represent the number o ...
- codeforces 613B B. Skills(枚举+二分+贪心)
题目链接: B. Skills time limit per test 2 seconds memory limit per test 256 megabytes input standard inp ...
- fzu 2035 Axial symmetry(枚举+几何)
题目链接:fzu 2035 Axial symmetry 题目大意:给出n个点,表示n边形的n个顶点,判断该n边形是否为轴对称图形.(给出点按照图形的顺时针或逆时针给出. 解题思路:将相邻两个点的中点 ...
随机推荐
- poj 23565-Find a multiple
Find a multiple The input contains N natural (i.e. positive integer) numbers ( N <= 10000 ). Each ...
- 2190: [SDOI2008]仪仗队(欧拉函数)
2190: [SDOI2008]仪仗队 Time Limit: 10 Sec Memory Limit: 259 MBSubmit: 3235 Solved: 2089 Description 作 ...
- centos使用--vsftpd配置
目录 1 在服务器配置FTP服务 1.1 在root权限下,通过如下命令安装Vsftp(以CentOS系统为例): 1.2 在启动vsftpd服务之前,需要登录云服务器修改配置文件,禁用匿名登录. 1 ...
- C#入门篇-3:数据类型及转换
using System; using System.Text; using System.Collections; using System.Collections.Generic; //003 查 ...
- IntelliJ IDEA 视频教程
相关视频教程: Intellij IDEA视频教程 最新版Intellij IDEA视频教程
- STL学习笔记6 -- 栈stack 、队列queue 和优先级priority_queue 三者比较
栈stack .队列queue 和优先级priority_queue 三者比较 默认下stack 和queue 基于deque 容器实现,priority_queue 则基于vector 容器实现 ...
- c++ 吕凤翥 第五章 类对象一
一 类的声明和实现 1. class tdate //声明部分 { public: void setdate(int y,int m,int d); int isleapyear(); voi ...
- c++ primer plus 第6版 部分二 5- 8章
---恢复内容开始--- c++ primer plus 第6版 部分二 5- 章 第五章 计算机除了存储外 还可以对数据进行分析.合并.重组.抽取.修改.推断.合成.以及其他操作 1.for ...
- Solr配置Ikanalyzer分词器
上一篇文章讲解在win系统中如何安装solr并创建一个名为test_core的Core,接下为text_core配置Ikanalyzer 分词器 1.打开text_core的instanceDir目录 ...
- springmvc支持跨域的请求(复制)
Spring MVC 新增跨域支持 发表于2017/5/8 22:01:24 48人阅读 分类: SpringMVC Spring MVC 4.2 增加 CORS 支持 跨站 HTTP 请求(Cro ...