首页 > 其他 > 详细

5.23 VJ D - Kana and Dragon Quest game

时间:2020-05-23 12:32:27      阅读:59      评论:0      收藏:0      [点我收藏+]
#include<bits/stdc++.h>
#define ll long long
using namespace std;
/*
题意:怪物血量为x,可以使用两种技能,分别为x/2+10和x-10,当x<=10时不能使用技能1
*/
int main()
{
    int t,x,n,m;
    cin>>t;
    for(int i=0; i<t; i++)
    {
        cin>>x>>n>>m;
        while(n--)//循环使用技能1直到x<=10或技能1用完
        {
            if(x<=10)
            {
                break;
            }
            x/=2;
            x+=10;
        }
        if(x<=m*10)//判断技能2是否够打完怪物剩下的血量(x)
        {
            cout<<"YES"<<endl;
        }
        else
        {
            cout<<"NO"<<endl;
        }
    }
}

5.23 VJ D - Kana and Dragon Quest game

原文:https://www.cnblogs.com/SyrupWRLD999/p/12941876.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!