hdu2199(高精度二分模版)
Now please try your lucky.
#include<iostream>
#include<math.h>
#include<stdio.h>
using namespace std;
double deal(double x)
{
return 8*pow(x,4)+7*pow(x,3)+2*pow(x,2)+3*x+6;
}
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
double x,sum,l=0,r=100;
scanf("%lf",&sum);
if(sum<deal(0)||sum>deal(100.0))
{
printf("No solution!\n");
continue;
}
else
{
double mid;
int flg=0;
while(r-l>1e-6)
{
mid=(l+r)/2;
if(deal(mid)>sum)
r=mid;
else
l=mid;
}
printf("%.4lf\n",r);
}
}
return 0;
}
hdu2199(高精度二分模版)的更多相关文章
- POJ 2109 Power of Cryptography【高精度+二分 Or double水过~~】
题目链接: http://poj.org/problem?id=2109 参考: http://blog.csdn.net/code_pang/article/details/8263971 题意: ...
- poj 1064 高精度 二分
Cable master Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 32191 Accepted: 6888 Descrip ...
- poj2018(高精度二分+dp)
题意:给你n个数,要你在这n个数里面找到一些连续的数,这些数的数量大于等于m,并且他们的平均值在这n个数里面是最大的....... 思路:先把n个数的最大最小值确定,然后二分枚举平均值,对于每一个连续 ...
- Can you solve this equation?---hdu2199(二分)
http://acm.hdu.edu.cn/showproblem.php?pid=2199 给出y的值求x: 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 = Y x是0到100的 ...
- CodeForce-782B The Meeting Place Cannot Be Changed(高精度二分)
https://vjudge.net/problem/CodeForces-782B B. The Meeting Place Cannot Be Changed time limit per tes ...
- 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 ...
- [HNOI2004]高精度开根
题目:洛谷P2293.BZOJ1213. 题目大意:给你$n,k(n\leq 10^{10000},k\leq 50)$,求$\lfloor \sqrt[k]{n}\rfloor$. 解题思路:高精度 ...
- NOIP初赛:完善程序做题技巧
最近写的文章好像还很多的.那么今天我们来讨论NOIP初赛的题型--完善程序.完善程序相对是比较难的题目了.全卷100分,完善程序占了大概26分,占比非常大.如果和英语考试试卷做比较,相当于首字母填空( ...
- [POJ2109]Power of Cryptography
[POJ2109]Power of Cryptography 试题描述 Current work in cryptography involves (among other things) large ...
随机推荐
- Python之上下文管理器
# -*- coding: utf-8 -*- #python 27 #xiaodeng #Python之上下文管理器 #http://python.jobbole.com/82620/ #语法形式: ...
- python之模块csv之CSV文件的写入(基本结构)
# -*- coding: utf-8 -*- #python 27 #xiaodeng #CSV文件的写入(基本结构) import csv #csv文件,是一种常用的文本格式,用以存储表格数据,很 ...
- hosts.allow hosts.deny
简单控制访问ip,hosts.allow/hsots.deny a simple access control language that is based on client (host name ...
- BeanUtils 装载java bean
Topic topic=new Topic(); Enumeration<String> enums=request.getParameterNames(); try { while(en ...
- 安卓开发应该知道的Drawable、Bitmap、Canvas和Paint的关系
首先让我们理解下Android平台中的显示类是View,但是还提供了底层图形类android.graphics,今天所说的这些均为graphics底层图形接口. Bitmap - 称作位图,一般位图的 ...
- URL 长度有限制吗?
众所周知,传递小量参数(在没有其他原因,例如隐藏参数值的情况下)推荐使用GET方法,传递大量参数推荐使用POST方法.原因是什么呢? 原因是传说GET方法是通过URL来传递,而URL的长度是受限的,而 ...
- Hive学习之函数DDL和Show、Describe语句
创建/删除函数 创建暂时函数 以下的语句创建由class_name实现的暂时函数,该函数被创建后仅仅能够在当前会话中使用.会话结束后函数失效. 实现函数的类能够是Hive类路径中的随意类.能够使用Ad ...
- Python 列表 reverse() 方法
描述 Python 列表 reverse() 方法对列表中的元素进行反向排序. 语法 reverse() 方法语法: L.reverse() 参数 无. 返回值 该方法没有返回值,但是会对列表的元素进 ...
- SIPp常用脚本之三:UAC
UAC是作为SIP消息的发起端,可以控制消息速率什么的,方便极了. 一.uac.xml <?xml version="1.0" encoding="ISO-8859 ...
- PI专利网站
PI专利网站: 1.http://www.powerint.com/company/patents/trademarks 2.http://patft.uspto.gov/netacgi/nph-Pa ...