URAL 1011(枚举)
来源:互联网 发布:品源照明淘宝旗舰店 编辑:程序博客网 时间:2024/06/06 07:46
题意:黑书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 1011(枚举)
- URAL - 1792 Hamming Code(枚举)
- URAL 1792. Hamming Code (枚举)
- URAL 1200. Horns and Hoofs 枚举+数学
- URAL 1221. Malevich Strikes Back! 枚举 暴力
- URAL 1500. Pass Licenses 枚举+位运算
- URAL 2031. Overturned Numbers (枚举)
- URAL 1221 Malevich Strikes Back! (暴力枚举)
- URAL 1152 False Mirrors (DFS枚举)
- URAL 2070 Interesting Numbers (素数枚举)
- URAL 1495. One-two, One-two 2(暴力枚举)
- URAL 1156 Two Rounds (DFS二分染色 + DFS枚举 + 剪枝)
- URAL 1044 Lucky Tickets. Easy! 搜索打表枚举
- URAL 1132 Square Root 暴力枚举,二次剩余.
- ural 1011 Conductors
- URAL 1011 Conductors
- URAL 1011|Conductors|暴力
- URAL
- 向往Cmd模式下的入侵吗
- POJ 1258 (最小生成树 kruskal)
- sqlserver2000升级到2005总结
- ubuntu apt-get dpkg应用中的一些问题及解决方法
- 读书笔记_UML基础,案例与应用
- URAL 1011(枚举)
- 麦克风不能录音解决方案汇总
- Struts2上传文件大小设置
- POJ2886线段树 Joseph游戏(单点更新)
- android 垂直 SeekBar 源代码(VerticalSeekBar)
- Android 开发常用代码片段
- 过年小记
- hdu 1232 畅通工程
- 校内发状态的神器