题意:给定一个 r 和 h,r 是上面那个半球的半径,h 是下面那个圆柱的高度,然后有一些半径为 r/2的气球,问你最多能放几个. 析:根据题意,很容易知道,先从下面往上放,两个两个的放,放到不能放的时候,再计算在上面是不是还能再放一个.这样是最多的,关键是计算上面那能不能放上,用到几何中的两圆的位置关系, 可以看出从下往上放气球的时候,球心最高只能到半球和圆柱的交线处,所以我们就可以很轻松计算两个两个的放,最多可以放几组,也就是h + r 整除以 r,要整数,然后再计算以后那一个圆, 那个圆最…
转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud C. Cupboard and Balloons A girl named Xenia has a cupboard that looks like an arc from ahead. The arc is made of a semicircle with radius r (the cupboard's top) and two walls of height h (the…
C. Cupboard and Balloons time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A girl named Xenia has a cupboard that looks like an arc from ahead. The arc is made of a semicircle with radius r …
http://codeforces.com/contest/342/problem/C #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> using namespace std; __int64 r,h; int main() { while(scanf("%I64d%I64d",&r,&h)!=EOF) { __int64…
Vanya and Balloons 枚举中心去更新答案, 数字过大用log去比较, 斜着的旋转一下坐标, 然后我旋出来好多bug.... #include<bits/stdc++.h> #define LL long long #define LD long double #define ull unsigned long long #define fi first #define se second #define mk make_pair #define PLL pair<LL,…
time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output One tradition of ACM-ICPC contests is that a team gets a balloon for every solved problem. We assume that the submission time doesn't matter and…
题目大概说给一张地图,地图每个格子都有0到9中的某一个数字.现在要在一个格子放炸弹,炸弹爆炸后水柱有两种扩展方式,一种是上.下.左.右,另一种是左上.右下.右上.左下,且四个方向的长度都一样.问放哪个格子怎么爆炸使得水柱覆盖的格子上的数字乘积最大,结果模1e9+7. 这题不会做.. 首先,各个格子的值取对数,这个为了比大小,因为需要模数,通过取对数缩小值.另外也把乘法转化成加法.这是个挺经典的技巧. 接下来,水柱的话肯定不能延长到0,不然功亏一篑,那么利用DP求出各个格子向8各个方向能延长多长,…
前言 博主太弱了 题解 这道题目是一个简单的贪心. 首先毋庸置疑,柜子的下半部分是要放满的. 于是我们很容易想到,分以下三种情况考虑: \[\small\text{请不要盗图,如需使用联系博主}\] 我们考虑如何辨别情况,不妨设\(m\ \%\ r\)为\(\ left\),如果\(left < \frac{r}{2}\),那么显然当前的情况是1:如果\(\frac{r}{2} \leq left<\frac{\sqrt{3}r}{2}\),那么显然当前的情况是2:如果\(\frac{\sqr…
CodeForces Round 199 Div2   完了,这次做扯了,做的时候有点发烧,居然只做出来一道题,差点被绿. My submissions     # When Who Problem Lang Verdict Time Memory 4434550 Sep 9, 2013 11:57:20 AM OIer E - Xenia and Tree GNU C++ Accepted 842 ms 4260 KB 4434547 Sep 9, 2013 11:56:11 AM OIer…
完了,这次做扯了,做的时候有点发烧,居然只做出来一道题,差点被绿. My submissions     # When Who Problem Lang Verdict Time Memory 4434550 Sep 9, 2013 11:57:20 AM OIer E - Xenia and Tree GNU C++ Accepted 842 ms 4260 KB 4434547 Sep 9, 2013 11:56:11 AM OIer E - Xenia and Tree GNU C++ W…