cf1104d二分+数学】的更多相关文章

#include<bits/stdc++.h> using namespace std; bool ask(int x,int y){ printf("? %d %d\n",x,y); fflush(stdout); ]; scanf("%s",buf); ]=='x'; } int work(){ ,)); ,r,ans,mid; ,l))l*=; r=l*+,r=min(r,); while(l<=r){ mid=l+r>>; )/…
题目链接:http://lightoj.com/volume_showproblem.php?problem=1137 题意:有一根绳子的长度为l,在有温度的情况下会变形为一个圆弧,长度为 l1 = (n*c+1)*l;求图中的h;并说明增加的长度不超过原长度的一半: 我们可以二分h,然后根据h求弧长,比较一下和l1的长度即可: 把弧长公式记错我也是醉了:   #include <stdio.h> #include <algorithm> #include <cstring&…
A - Luggage DistributionTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87493#problem/A Description All provident tourists know about low-cost airlines. Those who used them at least once also know th…
POJ 1759 Garland  这个题wa了27次,忘了用一个数来储存f[n-1],每次由于二分都会改变f[n-1]的值,得到的有的值不精确,直接输出f[n-1]肯定有问题. 这个题用c++交可以过,g++交过不了, f[i]=2+2*f[i-1]-f[i-2]; f[0]=A,f[1]=x; 二分枚举x的值,最终得到B的值(不是f[n-1]), 上述递推式是非齐次的二阶递推式,解其齐次特征方程,可以得到f[n-1]的齐次时的表达式,对于非齐次的,目前我还没法求出通式, B与f[n-1]的关…
D. Nature Reserve 题目链接:https://codeforces.com/contest/1059/problem/D 题意: 在二维坐标平面上给出n个数的点,现在要求一个圆,能够容纳所有的点,并且与x轴相切的最小半径为多少. 题解: 容易知道圆的纵坐标的绝对值等于其半径,并且半径越大,容纳圆的可能性越大,那么就考虑二分其半径,这样y0值也确定了. 但x值不是很好求.这里我们找到y=y0的那一条线,然后根据半径以及y0,yi值,可以求出当x0在哪一段时,能够包含(xi,yi)这…
E. Startup Funding 题目连接: http://codeforces.com/contest/633/problem/E Description An e-commerce startup pitches to the investors to get funding. They have been functional for n weeks now and also have a website! For each week they know the number of u…
B. A Trivial Problem 题目连接: http://www.codeforces.com/contest/633/problem/B Description Mr. Santa asks all the great programmers of the world to solve a trivial problem. He gives them an integer m and asks for the number of positive integers n, such t…
智商杯考试 题目连接: http://acm.uestc.edu.cn/#/problem/show/1277 Description 你是一个挂科选手. 你现在正在考试,你很方. 你参加的考试叫做智商杯考试. 这个考试很奇怪,考试一开始就把所有答案全部发给你了,但是并不告诉你答案和考试题目的对应关系,也就是说你根本不知道这个答案是哪个题目的. 由于智商低的原因,你根本看不懂题目,所以从题目来推断答案究竟属于哪个题目是不可能的-- 但是别慌,你可以向监考老师提问嘛. 智商杯的监考老师可是很人道的…
E. Thoroughly Bureaucratic Organization 题目连接: http://www.codeforces.com/contest/201/problem/E Description Once n people simultaneously signed in to the reception at the recently opened, but already thoroughly bureaucratic organization (abbreviated TB…
http://acm.hust.edu.cn/vjudge/contest/126149#problem/H 给定一条二次函数 f (x) = a * x * x + b * x + c 求一个最小的k,使得f(x) + f(x + 1) + f(x + 2) ..... + f(x + k - 1) 不等于 0 恒成立. 首先把参数统一写成 x + t这样的形式,然后带入去 化简有:a*x*x + (2*a*t+b)*x + a*t*t+b*t+c //现在的t是从0--k-1 列出k个式子,…