Y2K Accounting Bug POJ
来源:互联网 发布:ubuntu注销用户命令 编辑:程序博客网 时间:2024/05/14 12:33
前五个月的选取,一共有五种情况,然后后面的情况其实已经定了(贪心)。将5种情况枚举
#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <cmath>using namespace std;double a[20];int main(){ double s,d; while(scanf("%lf %lf",&s,&d)!=EOF) { if(s*4<d) { if(10*s<2*d) printf("Deficit\n"); else printf("%.0f\n",10*s-2*d); } else if(3*s<2*d) { if(2*s<d) printf("Deficit\n"); else printf("%.0f\n",8*s-4*d); } else if(2*s<3*d) { if(s<d) printf("Deficit\n"); else printf("%.0f\n",6*s-6*d); } else if(s<4*d) { if(3*s<9*d) printf("Deficit\n"); else printf("%.0f\n",3*s-9*d); } else printf("Deficit\n"); } return 0;}
0 0
- POJ Y2K Accounting Bug
- 【POJ】Y2K Accounting Bug
- Y2K Accounting Bug POJ
- Y2K Accounting Bug poj
- POJ 2586 Y2K Accounting Bug
- poj-2586-Y2K Accounting Bug
- poj 2586 Y2K Accounting Bug
- POJ 2586 Y2K Accounting Bug
- POJ 2586 Y2K Accounting Bug
- poj - 2586 - Y2K Accounting Bug
- POJ 2586.Y2K Accounting Bug
- 水题 poj Y2K Accounting Bug
- POJ 2586 Y2K Accounting Bug
- poj 2586 Y2K Accounting Bug
- poj 2586 Y2K Accounting Bug
- poj 2586 Y2K Accounting Bug
- POJ 2586 Y2K Accounting Bug
- POJ 2586 Y2K Accounting Bug
- Python爬虫抓取携程网机票信息并发邮件通知
- bzoj4540 序列
- 题目1432:叠筐
- 诗一首
- Mysql的安装(linux下)
- Y2K Accounting Bug POJ
- python中*args **kw到底是什么意思?
- 04-树4 是否同一棵二叉搜索树 (25分)
- mybatis generator
- 致我的第一篇博客
- 题目1433:FatMouse
- JAVA大数处理(BigInteger,BigDecimal)
- JSP(5)开发模式web-service等介绍
- 【LeetCode】Search Insert Position 解题报告