[CF912A]Tricky Alchemy
题意:你有a个黄水晶和b个蓝水晶,要求要x个黄水晶球(2黄),y个绿水晶球(1黄1蓝),z个蓝水晶球(3蓝),问还要多少水晶
题解:模拟
C++ Code:
#include<cstdio> using namespace std; long long y,b,ny,ng,nb,ans=0; long long max(long long a,long long b){return a>b?a:b;} int main(){ scanf("%I64d%I64d",&y,&b); scanf("%I64d%I64d%I64d",&ny,&ng,&nb); ans=max(0,2*ny+ng-y)+max(0,ng+3*nb-b); printf("%I64d\n",ans); return 0; }