Y2K Accounting Bug(poj2586)
x=2: sssdd,sssdd,ss 2d>3s 赢利8个月 8s-4d
x=3: ssddd,ssddd,ss 3d>2s 赢利6个月 6s-6d
x=4: sdddd,sdddd,sd 4d>s 赢利3个月 3s-9d
x=5: ddddd,ddddd,dd 4d<s 无赢利
#include <stdio.h>
#include <string.h>
int main()
{
long long s,d,sum;
while (scanf("%lld%lld",&s,&d)!=EOF)
{
sum=0;
if(d>4*s)
sum=10*s-2*d;
else if(2*d>3*s)
sum=8*s-4*d;
else if(3*d>2*s)
sum=6*s-6*d;
else if(4*d>s)
sum=3*s-9*d;
else sum=-1;
if (sum<0)
printf ("Deficit\n");
else printf ("%lld\n",sum); }
return 0;
}
Y2K Accounting Bug(poj2586)的更多相关文章
- poj2586 Y2K Accounting Bug(贪心)
转载请注明出处:http://blog.csdn.net/u012860063?viewmode=contents 题目链接:http://poj.org/problem?id=2586 ------ ...
- POJ 2586:Y2K Accounting Bug(贪心)
Y2K Accounting Bug Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10024 Accepted: 4990 D ...
- POJ 2586 Y2K Accounting Bug(枚举洪水问题)
Y2K Accounting Bug Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10674 Accepted: 53 ...
- POJ 2586 Y2K Accounting Bug(枚举大水题)
Y2K Accounting Bug Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10674 Accepted: 53 ...
- [POJ 2586] Y2K Accounting Bug (贪心)
题目链接:http://poj.org/problem?id=2586 题目大意:(真难读懂啊)给你两个数,s,d,意思是MS公司每个月可能赚钱,也可能赔钱,如果赚钱的话,就是赚s元,如果赔钱的话,就 ...
- POJ 2586 Y2K Accounting Bug(贪心)
题目连接:http://poj.org/problem?id=2586 题意:次(1-5.2-6.3-7.4-8.5-9.6-10.7-11.8-12),次统计的结果全部是亏空(盈利-亏空<0) ...
- [POJ2586]Y2K Accounting Bug
[POJ2586]Y2K Accounting Bug 试题描述 Accounting for Computer Machinists (ACM) has sufferred from the Y2K ...
- POJ2586——Y2K Accounting Bug
Y2K Accounting Bug Description Accounting for Computer Machinists (ACM) has sufferred from the Y2K ...
- Y2K Accounting Bug(贪心)
Y2K Accounting Bug Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10945 Accepted: 54 ...
随机推荐
- thinkphp 多对多关联模型(转)
先建立一个模型 1 2 3 4 5 6 7 8 9 10 11 12 <?php class UserModel extends RelationModel{ protected $ ...
- VC++生成不同的随机数
其用法是先调用srand函数,如 srand( (unsigned)time( NULL ) ) 这样可以使得每次产生的随机数序列不同.假如计算伪随机序列的初始数值(称为种子)相同,则计算出来的伪随机 ...
- jQuery().end()的内部实现及源码分析
jQuery().end()的作用是返回当前jQuery对象的上一个状态. 1.end()源码: // 所有通过pushStack方法获得的jQuery对象都可以通过end方法返回之前的状态 // ...
- 使用mimikatz获取和创建Windows凭据的工具和方法
Mimikatz 下载地址 https://github.com/gentilkiwi/mimikatz/releases 本地凭据破解 以管理员身份运行(拿到shell提权后) mimikatz#p ...
- [转]了解如何通过reverse_iterator的base得到iterator
转自:http://blog.csdn.net/shuchao/article/details/3705252 调用reverse_iterator的base成员函数可以产生“对应的”iterator ...
- C# 日志系统 log4net 配置及使用
1.引用Dll 版本是:1.2.10.0,下载Dll 2.Web.config文件配置 <?xml version="1.0" encoding="utf-8&qu ...
- Android 简单计算器实现源码
1.string.xml代码 <?xml version="1.0" encoding="utf-8"?> <resources> &l ...
- express运行原理
一.express底层:http模块 Express框架建立在node.js内置的http模块上.http模块生成服务器的原始代码如下. var http = require("http&q ...
- Olivia Palermo & Johannes Huebl 模范情侣
男才女貌,模范情侣-- 以后引用情侣时就用这个图了~ ref: http://bbs.55bbs.com/thread-8250584-1-1.html
- codeforces 779D - String Game
time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standa ...