(二分搜索)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 ( ...
随机推荐
- (判断)window.open()窗口被关闭后执行事件
$(function() { // start ready var $article_share=$('#body .article').find('li.share'); // $article_s ...
- Jython:java调用python文件之第三方包路径问题
本文转载自:http://blog.csdn.net/ztf312/article/details/51338060 本方法解决python代码的可移植性,不需要在新机器上配置python环境,只通过 ...
- C++ 类外定义
类内定义与内联函数 像下面这种函数名与函数体都写在类里面的函数形式被称作类内定义,编译器编译的时候会把它默认成内联函数. class Student { public: void setAge(int ...
- MySQL锁之二:锁相关的配置参数
锁相关的配置参数: mysql> SHOW VARIABLES LIKE '%timeout%'; +-----------------------------+----------+ | Va ...
- 1021 docker搭建mysql、网络模式、grid
1.搭建并连接mysql服务 1.1.mysql官方命令 https://hub.docker.com/_/mysql/ #下载mysql镜像: docker pull mysql #启动mysql: ...
- 基础html和css知识
No1.HTML 1.网页结构 网页结构一般都包含文档声明DOCTYPE,并且在head中的meta应该包含编码格式.关键字.网页描述信息.简单格式如下: <!DOCTYPE html> ...
- Elasticsearch client node 启动时出现警告:exception caught on transport layer 及java.net.NoRouteToHostException: No route to host
发现该问题源自发现kibana不能打开sense,并且看见elasticsearch插件处于服务不可用状态,但是在client node上curl localhost:9200发现能够返回ES基本信息 ...
- ThreadPoolExecutor – Java Thread Pool Example
https://www.journaldev.com/1069/threadpoolexecutor-java-thread-pool-example-executorservice Java t ...
- 常规Java工具,算法,加密,数据库,面试题,源代码分析,解决方案
原文链接:http://www.tvtvso.top/?thread-5.htm 有家杂志曾对全国60岁以上的老人进行了这样一次问卷调查:你最后悔什么? 列出10项人们生活中容易后悔的事情,供被调查者 ...
- 如何更改Windows10的计算机基本信息
请问如何去掉红色框内的内容?优化大师更改无效! 最佳答案 打开注册表,定位到如下路径 1 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current ...