1636. Penalty Time
Time limit: 1.0 second
Memory limit: 64 MB
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;
}