CodeForces 409C Magnum Opus

题目链接:CodeForces 409C Magnum Opus

解题思路:

读懂题目是关键。。。简单来讲就是每次炼金都需要1个Aqua Fortis,1个Aqua Regia,2个Amalgama,7个Minium,4个Vitriol

代码:

#include
#include
#include
#include<string>
#include
using namespace std;

int main()
{
    int xs,ws,cg,q,f;
    while(~scanf("%d %d %d %d %d",&xs,&ws,&cg,&q,&f))
    {
        int sum=0;
        while(xs>=1&&ws>=1&&cg>=2&&q>=7&&f>=4)
        {
            sum++;
            xs-=1;
            ws-=1;
            cg-=2;
            q-=7;
            f-=4;
            //printf("%d %d %d %d %d\n",xs,ws,cg,q,f);
        }
        printf("%d\n",sum);
    }
}

 

转载于:https://www.cnblogs.com/KasenBob/p/10828002.html

你可能感兴趣的:(CodeForces 409C Magnum Opus)