当前位置:网站首页>acwing 790. The third root of a number (dichotomy)
acwing 790. The third root of a number (dichotomy)
2022-06-13 09:25:00 【Age worry】
subject :790. The third root of a number 
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
double n;
scanf("%lf",&n);
double i=-10000,j=10000;
while(i+1e-8<j){
double mid=(i+j)/2;
if(mid*mid*mid<n) i=mid;
else j=mid;
}
printf("%.6lf",i);
return 0;
}
边栏推荐
- C language: data storage in memory
- Attack and defense world PWN shell
- LeetCode 583. 两个字符串的删除操作
- JUC atomic reference and ABA problem
- 7-3 virus traceability (20 points)
- 阿里高级专家剖析 | Protocol的标准设计
- LeetCode 6097. Match after replacing characters (Dictionary)
- 计算两个时间相差的天数(支持跨月、跨年)
- LeetCode 5259. Calculate the total tax payable
- 202012 CCF test questions
猜你喜欢

20211020 academician all drive system

How Simulink adds modules to the library browser

Dynamic display of analog clock using digital clock in turtle Library

阿里高级专家剖析 | Protocol的标准设计

Class loading overview

C language: deep understanding of character functions and string functions (1)

C language: five custom types

(dfs) acwing 842. Arrange numbers

Overview of common layers of image recognition neural network (under update)

C language: recursive function to realize Hanoi Tower
随机推荐
C language: Address Book
ROS2之OpenCV人脸识别foxy~galactic~humble
Simple use of spiel expressions
Exporting MySQL data table documents using Navicat
C language: minesweeping
JUC 字段更新器
C language: deep understanding of pointers and arrays
Storage mode of drawings
LeetCode 6096. 咒语和药水的成功对数(二分查找)
Jenkins accédant à l'authentification de l'utilisateur openldap
Immutability of shared model
LeetCode 322. Change
批量读取文件夹下的全部语音文件
How to build an aby framework and run an instance
LeetCode 6095. 强密码检验器 II
Musk's "meta universe" dream
线上调试工具Arthas高级
LeetCode 6098. 统计得分小于 K 的子数组数目(前缀和+二分查找)
Necessary and sufficient conditions for diagonalization of 20211115 matrix; The full rank matrix does not necessarily have n linearly independent eigenvectors; Symmetric matrices must be diagonalized
Can the operation of the new BMW I3 meet the expectations of the famous products of the 3 series?