CodeForces 342C Cupboard and Balloons
来源:互联网 发布:拍淘宝静物用什么相机 编辑:程序博客网 时间:2024/06/10 20:49
往一个由半圆和长方形组成的盒子里放气球。
重点考虑顶部那部分,放一个,两个,还是三个。计算一下能放下三个的极限情况就可以了。
#include<stdio.h>#include<iostream>#include<math.h>#include<string.h>#include<iomanip>#include<stdlib.h>#include<ctype.h>#include<algorithm>#include<deque>#include<functional>#include<iterator>#include<vector>#include<list>#include<map>#include<queue>#include<set>#include<stack>#define CPY(A, B) memcpy(A, B, sizeof(A))typedef long long LL;typedef unsigned long long uLL;const int MOD = int (1e9) + 7;const int INF = 0x3f3f3f3f;const LL INFF = 0x3f3f3f3f3f3f3f3fLL;const double EPS = 1e-9;const double OO = 1e20;const double PI = acos (-1.0);const int dx[] = {-1, 0, 1, 0};const int dy[] = {0, 1, 0, -1};using namespace std;int main() { double r,h; while (cin>>r>>h) { int ans= (int) (h/r) *2; h-= (int) ans*r/2; if (h>=r/2) { ans+=2; h-=r; } h+= (2-sqrt (3) ) *r/2; if (h>=0) { ans++; } cout<<ans<<endl; } return 0;}
0 0
- CodeForces 342C Cupboard and Balloons
- codeforces #199 C. Cupboard and Balloons 题解
- CodeFroces342 C. Cupboard and Balloons
- Codeforces Round #199 (Div. 2) C. Cupboard and Balloons
- Codeforces Round #199 (Div. 2) C. Cupboard and Balloons
- Codeforces Round #199 (Div. 2) C. Cupboard and Balloons
- CF 342C(Cupboard and Balloons-难得对的贪心)
- cf 342C - Cupboard and Balloons(计算几何)
- Cupboard and Balloons
- Codeforces Round #199 (Div. 2) -- C. Cupboard and Balloons (数学)
- Codeforces Round #199 (Div. 2) C. Cupboard and Balloons(数学)
- 【模拟】Cupboard and Balloons
- 【codeforces 782C】Andryusha and Colored Balloons
- codeforces 782c Andryusha and Colored Balloons
- Codeforces 780C-Andryusha and Colored Balloons
- Codeforces Round #403 (Div. 2) C. Andryusha and Colored Balloons
- Codeforces 782C Andryusha and Colored Balloons dfs
- Codeforces Round #403 C. Andryusha and Colored Balloons(DFS)
- Java环境的搭建
- 让您的Xcode键字如飞
- [Cloud Computing]Mechanisms: Cloud Usage Monitor
- nodejs:Excel导出json
- C++匿名命名空间
- CodeForces 342C Cupboard and Balloons
- eclipse最有用快捷键整理
- 【千里码】Task1-码之初
- hdu 4099 Revenge of Fibonacci 字典树+斐波拉契数列数列
- 1001
- Layer2-3 VLAN和DTP
- open函数的flag详解1
- org.json与json-lib的区别
- 简易抽屉实现