二分
文章平均质量分 56
libulala
算法练习
展开
-
Stressful Training
** Stressful Training** Berland SU holds yet another training contest for its students today. n students came, each of them brought his laptop. However, it turned out that everyone has forgot their chargers! Let students be numbered from 1 to n. Laptop of原创 2021-02-08 01:59:27 · 150 阅读 · 0 评论 -
Magic Ship
Magic Ship You a captain of a ship. Initially you are standing in a point (x1,y1) (obviously, all positions in the sea can be described by cartesian plane) and you want to travel to a point (x2,y2). You know the weather forecast — the string s of length n,原创 2021-02-08 01:54:43 · 132 阅读 · 0 评论 -
Can you solve this equation?
Can you solve this equation? Now,given the equation 8x^4 + 7x^3 + 2x^2 + 3x + 6 == Y,can you find its solution between 0 and 100; Now please try your lucky. Input The first line of the input contains an integer T(1<=T<=100) which means the number of原创 2021-02-08 01:38:47 · 82 阅读 · 0 评论 -
Monthly Expense
Monthly Expense Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤ moneyi ≤ 10,000) that he will need to spend each day over the n原创 2021-02-08 01:33:06 · 87 阅读 · 0 评论 -
一元三次方程求解
一元三次方程求解 有 一个一元三次方程。给出该方程中各项的系数(a , b , c ,d 均为实数),并约定该方程存在三个不同实根(根的范围−100至 100之间),且根与根之差的绝对值 ≥1。要求由小到大依次在同一行输出这三个实根(根与根之间留有空格),并精确到小数点后 2位。 输入格式 一行,4 个实数 A,B,C,D。 输出格式 一行, 3 个实根,并精确到小数点后 2 位。 Sample Input 1 -5 -4 20 Sample Output -2.00 2.00 5.00 对方称求导后算出原创 2021-02-08 01:23:02 · 318 阅读 · 0 评论 -
Pie
Pie 翔翔今天过生日,他很高兴,买了N个半径不一定相同的蛋糕给他的F个朋友吃,当然他自己也要吃,公平起见,每个人吃到的蛋糕的体积应该是一样的。已知蛋糕的高都是 1,请问每个人能吃到的最大的蛋糕的体积是多少 ?(注意:每个人的蛋糕都应该是一整块的,不能由多个小块组成,当然也可以是一整个蛋糕) Input 第一行输入一个T代表组数。 随后T组的第一行包含两个正整数N和F,1 ≤ N, F ≤ 10000和N个1到10000之间的整数,表示蛋糕的数量,朋友的数量。 第二行分别表示每个蛋糕的半径。 Output原创 2021-02-05 16:19:23 · 176 阅读 · 0 评论 -
切绳子
有 n条绳子,它们的长度分别为 Li,如果从它们中切割出 m 长度相同的绳子,这 m条绳子每条最长能有多长? 输入格式 第一行两个整数 n和 m。 接下来 n行,每行一个实数,描述了每条绳子的长度 Li 。 数据范围: 1≤n≤m≤104,1≤Li≤105。 输出格式 切割后每条绳子的最大长度,答案向下保留到小数点后 2位。 Sample Input 4 11 8.02 7.43 4.57 5.39 Sample Output 2.00 二分,但这个题超级坑,WA了五次,精度要求超高,所以最后改的思路就是原创 2021-02-05 16:17:12 · 516 阅读 · 0 评论