(二分搜索)Can you solve this equation? -- hdu -- 2199
链接:
http://acm.hdu.edu.cn/showproblem.php?pid=2199
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 13475 Accepted Submission(s): 6010
Now please try your lucky.
100
-4
代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <queue>
#include <algorithm>
using namespace std; const int oo = 0x3f3f3f3f;
const int N = ; int main()
{
int t;
scanf("%d", &t);
while(t--)
{
int flag=;
double y, l=, r=, x;
scanf("%lf", &y); double m = **** + *** + ** + * + ; if(fabs(y-m)<0.0001)
{
printf("100.0000\n");
continue;
} while(l<r)
{
x = (l+r)/;
m = *x*x*x*x + *x*x*x + *x*x + *x + ; if(fabs(m-y)<0.0001)
{
flag = ;
break;
}
else if(m>y)
r = x;
else if(m<y)
l = x;
} if(flag)
printf("%.4f\n", x);
else
printf("No solution!\n");
}
return ;
}
(二分搜索)Can you solve this equation? -- hdu -- 2199的更多相关文章
- C - Can you solve this equation? HDU - 2199(二分水题)
Now,given the equation 8x^4 + 7x^3 + 2x^2 + 3x + 6 == Y,can you find its solution between 0 and 100; ...
- hdu 2199 Can you solve this equation?(二分搜索)
Can you solve this equation? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K ( ...
- hdu 2199:Can you solve this equation?(二分搜索)
Can you solve this equation? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K ( ...
- hdu 2199 Can you solve this equation?(高精度二分)
http://acm.hdu.edu.cn/howproblem.php?pid=2199 Can you solve this equation? Time Limit: 2000/1000 MS ...
- HDU 2199 Can you solve this equation?(二分精度)
HDU 2199 Can you solve this equation? Now,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == ...
- HDU 2199 Can you solve this equation?(二分解方程)
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=2199 Can you solve this equation? Time Limit: 2000/10 ...
- ACM:HDU 2199 Can you solve this equation? 解题报告 -二分、三分
Can you solve this equation? Time Limit: / MS (Java/Others) Memory Limit: / K (Java/Others) Total Su ...
- HDU 2199 Can you solve this equation? (二分 水题)
Can you solve this equation? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K ( ...
- HDU 2199 Can you solve this equation(二分答案)
Can you solve this equation? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K ( ...
随机推荐
- emacs之配置etags
emacsConfig/etags-setting.el (require 'auto-complete-etags) (setq ac-sources (append '(ac-source-eta ...
- F5 源地址保持
Virtusl Server: Web Portal 建议选择成Source_Addr(源地址保持).因为Web Portal提供WEB服务给用户访问,压力比较大,而源地址保持的方式处理速度比Cook ...
- ROS使用国内的DDNS服务
未测试.转载余松老师的作品 虽然RouterOS 加入了cloud功能,但最近在配置RB2011的时候发现不好使,更新域名后无法正确解析到我的IP地址,虽然在cloud的public address中 ...
- Solr进行Distinct 获取Count
今天碰到一个问题,数据之前入solr的时候并没有计算条数,现在需要计算出某几个表中去重后的总数. 由于solr的ISearch并没有相关的Distinct功能.想到一个解决方案是用Solr的Facet ...
- oracle完全删除表空间
步骤一: 删除user drop user ×× cascade 说明: 删除了user,只是删除了该user下的schema objects,是不会删除相应的tablespace的. 步骤二: 删除 ...
- python之CMDB
浅谈ITIL TIL即IT基础架构库(Information Technology Infrastructure Library, ITIL,信息技术基础架构库)由英国政府部门CCTA(Central ...
- Pyhton项目实践:将带有美国风格日期的文件改名为欧洲风格日期
题目 项目要求:上千个文本文件,文件名包含美国风格的日期( MM-DD-YYYY),需要将它们改名为欧洲风格的日期( DD-MM-YYYY) 先写个创建一百个美国风格日期的文件 #! python # ...
- leetcode73
public class Solution { public void SetZeroes(int[,] matrix) { ); ); var listrow = new Dictionary< ...
- 创建django的8大步骤xxx.setAttribute('name', 'user'); 添加属性和值 xxx.attr('name') 查看属性的值 $(xxx).addClass 添加样式 $().after() 添加在标签后面
第一步.创建django 方法一:django-admin startproject 方法二: 直接在python上创建 第二步:创建工程名cmdb python manage.py startapp ...
- Nginx Linux yum安装
-- 安装>yum install nginx -y -- 查看>whereis nginx >目录>/usr/sbin/nginx 执行命令>/etc/nginx 配置 ...