标签:style os amp c++ on sp return hdu
分情况讨论
#include<bits/stdc++.h> using namespace std; int main() { long long h,a,b,k; int kase=1; while(scanf("%I64d%I64d%I64d%I64d",&h,&a,&b,&k)==4) { if(h==0&&a==0&&b==0&&k==0) break; printf("Case #%d: ",kase); kase++; if(h-a<1) //第一轮回复前击杀成功 { printf("YES\n"); continue; } if(a<=b) //一轮中伤害小于回复 击杀失败 { printf("NO\n"); continue; } if(h-k*(a-b)-b<1) //第一次休息前击杀成功 { printf("YES\n"); continue; } if(k*(a-b)-b<=0) //一个休息周期伤害小于回复 击杀失败 { printf("NO\n"); continue; } printf("YES\n"); //其他情况可以击杀成功 } return 0; }
HDU 4950 Monster,布布扣,bubuko.com
标签:style os amp c++ on sp return hdu
原文地址:http://blog.csdn.net/nenuxlp/article/details/38581135