URAL 1011(枚举)
2013-02-09 16:46
351 查看
题意:黑书P12 售货员
思路:不能有半个人。
思路:不能有半个人。
#include <cstdio> #include <cstring> #include <cmath> #include <iostream> #include <algorithm> #include <stack> #include <queue> using namespace std; const double EPS = 1e-12; double l,r; bool zero(double t) { return -EPS<t&&t<EPS; } bool find(int k) { if((int)(l*k)<(int)(r*k)&&!zero((r*k)-(int)(r*k))) return true; return false; } int main() { freopen("in.txt","r",stdin); while(~scanf("%lf%lf",&l,&r)) { l/=100;r/=100; for(int i=1;;i++) { if(find(i)) { printf("%d\n",i); break; } } } return 0; }
相关文章推荐
- URAL 2031. Overturned Numbers (枚举)
- Ural1042(高斯消元+枚举自由变元)
- BZOJ.1011.[HNOI2008]遥远的行星(思路 枚举)
- ural 1011. Conductors
- URAL 1200 Horns and Hoofs 枚举
- URAL 1152 False Mirrors (DFS枚举)
- ural 1011 Conductors
- URAL 2092 Bolero 暴力枚举
- URAL - 1792 Hamming Code(枚举)
- 2018_1_23_poj_1011_sticks_枚举_递归_剪枝
- URAL 1792. Hamming Code (枚举)
- URAL 1011|Conductors|暴力
- URAL 1011 Conductors
- URAL1011 - Conductors - 水题
- URAL 1011 Conductors
- 算法艺术与信息学竞赛习题1.2.4——售货员(ural1011 )
- URAL 1221. Malevich Strikes Back! 枚举 暴力
- URAL_2032_Conspiracy Theory and Rebranding(暴力枚举)
- URAL 1200. Horns and Hoofs 枚举+数学
- URAL 2031. Overturned Numbers (枚举)