poj 贪心相关之 Y2K Accounting Bug2586
来源:互联网 发布:林忆莲 野风 知乎 编辑:程序博客网 时间:2024/05/21 18:10
poj 贪心相关之 Y2K Accounting Bug2586
题意真的很难懂……
#include<iostream>#include<cstring>#include<cstdio>#include<math.h>#include<algorithm>#include<vector>#include<queue>using namespace std;int s, d;int main(){ //freopen("1.txt", "r", stdin); int cost; while (scanf("%d%d", &s, &d) != EOF) { if (4 * s < d) //SSSSDSSSSDSS cost = 10 * s - 2 * d; else if (3 * s<2 * d && 4 * s>d) //SSSDDSSSDDSS cost = 8 * s - 4 * d; else if (2 * s<3 * d && 3 * s>2 * d) //SSDDDSSDDDSS cost = 6 * s - 6 * d; else if (s<4 * d && 2 * s>3 * d) //SDDDDSDDDDSD cost = 3 * s - 9 * d; else cost = -1; if (cost > 0) printf("%d\n", cost); else printf("Deficit\n"); }}
阅读全文
0 0
- poj 贪心相关之 Y2K Accounting Bug2586
- 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 2586:Y2K Accounting Bug:贪心法
- poj 2586 Y2K Accounting Bug (贪心)
- POJ 2586:Y2K Accounting Bug(贪心)
- POJ 2580 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 简单贪心
- 2.Master主备机制切换源码分析
- HTML CSS 特殊字符表
- java socket 多线程编程
- Java集合---ArrayList的实现原理
- 设置弹出窗口的格式,也就是取消最小化最大化按钮样式
- poj 贪心相关之 Y2K Accounting Bug2586
- Tomcat Session过期时间sh
- vfs的数据结构
- Android : 二次确认退出应用程序
- C#中的PadLeft
- ffplay播放原始格式的音频文件(PCM)和视频文件(YUV)
- Leetcode 88 Merge Sorted Array
- OKR学习笔记
- LeetCode 203 Remove Linked List Elements