【Codeforces Round #456 (Div. 2) A】Tricky Alchemy

【链接】 我是链接,点我呀:)
【题意】

在这里输入题意

【题解】

统计需要的个数。 不够了,就买。

【代码】

#include <bits/stdc++.h>
#define ll long long
using namespace std;

ll a,b,x,y,z,ta,tb;

int main(){
	#ifdef LOCAL_DEFINE
	    freopen("rush_in.txt", "r", stdin);
	#endif
	ios::sync_with_stdio(0),cin.tie(0);
    cin >> a >> b;
    cin >> x >> y >> z;
    ll ta = 2*x + y + 0;
    ll tb = y + 3*z;
    ll ans = 0;
    if (ta > a) ans+=ta-a;
    if (tb>b) ans+=tb-b;
    cout << ans << endl;
	return 0;
}
原文地址:https://www.cnblogs.com/AWCXV/p/8213564.html