URAL 1636. Penalty Time

33 篇文章 0 订阅

1636. Penalty Time

Time limit: 1.0 second
Memory limit: 64 MB
The ZZZ team failed once again. They took part in the contest in Yekaterinozavodsk and were the first to solve all the problems. They did it even before the monitor was frozen. However, in the table of final results they were only second, because the QXX team had a better total time. A member of the QXX team supposes that it happened because the participants were unpunctual and used dirty debug methods. However, the captain of the ZZZ team claims that their complicated tactics had to be blamed for the failure, because even if all their solutions had been accepted in the first run the team would still have taken the second place. Find out which of them is right.

Input

The first line contains the total times in minutes  T 1 and  T 2 of the teams QXX and ZZZ, respectively, separated by a space  (250 ≤  T 1 ≤  T 2 ≤ 2400) . In the second line there are 10 integers separated by a space; the  ith integer is the number of rejected runs that the ZZZ team had when solving the ith problem. Recall that every rejected run increases the total time by 20 minutes.

Output

Output “No chance.” if the rejected runs had no impact on the final place of the ZZZ team. Otherwise, output “Dirty debug :(”. If total times are equal, the teams are sorted alphabetically, so in this case the ZZZ team is in the second place.

Samples

input output
290 420
0 0 0 2 1 0 2 0 1 0
No chance.
300 719
0 0 0 0 0 0 21 0 0 0
Dirty debug :(




解析:每次罚时20min,看所有罚时加上原来的时间是否大于对手的时间。直接计算即可。总时间相等时,ZZZ获胜。



AC代码:

#include <cstdio>

int main(){
    #ifdef sxk
        freopen("in.txt", "r", stdin);
    #endif // sxk


    int n, m, ans, foo;
    while(scanf("%d%d", &n, &m)==2){
        ans = 0;
        for(int i=0; i<10; i++){
            scanf("%d", &foo);
            ans += foo;
        }
        puts(ans * 20 + n <= m ? "No chance." : "Dirty debug :(");
    }
    return 0;
}



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值