【Codeforces Round #456 (Div. 2) A】Tricky Alchemy
Codeforces div round
2023-09-14 09:03:45 时间
【链接】 我是链接,点我呀:)
【题意】
【题解】
统计需要的个数。 不够了,就买。【代码】
#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;
}
相关文章
- 【Codeforces Round #694 (Div. 1) D】Strange Housing
- 【Codeforces Round #639 (Div. 2) B】Card Constructions
- 【Codeforces Round #635 (Div. 2) B】Kana and Dragon Quest game
- 【Codeforces Round #499 (Div. 1) B】Rocket
- 【Codeforces Round #482 (Div. 2) B】Treasure Hunt
- 【Codeforces Round #459 (Div. 2) B】 Radio Station
- 【Codecraft-18 and Codeforces Round #458 (Div. 1 + Div. 2, combined) A】 Perfect Squares
- 【Codeforces Round #451 (Div. 2) D】Alarm Clock
- 【Codeforces Round #453 (Div. 2) A】 Visiting a Friend
- 【Codeforces Round #446 (Div. 2) B】Wrath
- 【Codeforces Round #435 (Div. 2) C】Mahmoud and Ehab and the xor
- 【Codeforces Round #432 (Div. 2) A】 Arpa and a research in Mexican wave
- 【Codeforces Round #432 (Div. 1) A】 Five Dimensional Points
- 【Codeforces Round #428 (Div. 2) B】Game of the Rows
- Educational Codeforces Round 55 (Rated for Div. 2)
- Codeforces Round #459 (Div. 2)
- Codeforces Round #447 (Div. 2)
- Codeforces Round #434 (Div. 2, based on Technocup 2018 Elimination Round 1)
- Codeforces Round #431 (Div. 2)
- Codeforces Round #425 (Div. 2)
- Codeforces Round #420 (Div. 2)
- Codeforces Round #408 (Div. 2)
- 树状数组 Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) C. Fountains