B. The Meeting Place Cannot Be Changed The main road in Bytecity is a straight line from south to north. Conveniently, there are coordinates measured in meters from the southernmost build…
Toxophily Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1429    Accepted Submission(s): 739 Problem Description The recreation center of WHU ACM Team has indoor billiards, Ping Pang, chess an…
HDU 2254 奥运(矩阵高速幂+二分等比序列求和) ACM 题目地址:HDU 2254 奥运 题意:  中问题不解释. 分析:  依据floyd的算法,矩阵的k次方表示这个矩阵走了k步.  所以k天后就算矩阵的k次方.  这样就变成:初始矩阵的^[t1,t2]这个区间内的v[v1][v2]的和.  所以就是二分等比序列求和上场的时候了. 跟HDU 1588 Gauss Fibonacci的算法一样. 代码: /* * Author: illuz <iilluzen[at]gmail.com>…
题意:n个人,都要去參加活动,每一个人都有所在位置xi和Wi,每一个人没走S km,就会产生S^3*Wi的"不舒适度",求在何位置举办活动才干使全部人的"不舒适度"之和最小,并求最小值. 思路:首先能够得出最后距离之和的表达式最多仅仅有两个极点, 更进一步仅仅有一个极点,否则无最小值. 那么我们就可用三分法或者二分法求解.即对原函数三分或对导数二分就可以. #include<cstdio> #include<cstring> #inclu…
题意:给定x轴上有n个点,每一个点都有一个权值,让在x轴上选一个点,求出各点到这个点的距离的三次方乘以权值最小. 析:首先一开始我根本不会三分,也并没有看出来这是一个三分的题目的,学长说这是一个三分的题,我就百度了一下什么是三分算法,一看感觉和二分差不多,当然就是和二分差不多,也是慢慢缩短范围. 这个题也这样,在最左端和最右端不断的三分,直到逼进那个点,刚开始我设置的误差eps是10负8,但是TLE了,我以为是太小,三分数太多,然后我又改成10负6还是TLE,我又失望了,干脆我不用误差了,我让它…
代码+解析: 1 //题意: 2 //有一个大炮在(0,0)位置,为你可不可以把炮弹射到(x,y)这个位置 3 //题目给你炮弹初始速度,让你求能不能找出来一个炮弹射出时角度满足题意 4 //题解: 5 //由物理公式分析可知: 6 //Vx=v*cos(a) 7 //Vy=v*sin(a) 8 //t=x/Vx=x/(v*cos(a)) 9 //y=-(1/2)*g*t*t+Vy*t=-(1/2)*g*t*t+v*sin(a)*t 10 //一看是一个一元二次函数那他的图像不是先减后增就是先增…
Problem Description In the Dark forest, there is a Fairy kingdom where all the spirits will go together and Celebrate the harvest every year. But there is one thing you may not know that they hate walking so much that they would prefer to stay at hom…
Party All the Time Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4282    Accepted Submission(s): 1355 Problem Description In the Dark forest, there is a Fairy kingdom where all the spirits wil…
Time Limit: 6000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6979 Accepted Submission(s): 2181 Problem Description In the Dark forest, there is a Fairy kingdom where all the spirits will go together and Celebr…
http://acm.hdu.edu.cn/showproblem.php?pid=2236 题意:中文题意. 思路:先找出最大和最小值,然后二分差值,对于每一个差值从下界开始枚举判断能不能二分匹配. #include <cstdio> #include <algorithm> #include <iostream> #include <cstring> #include <string> #include <cmath> #incl…