よじろめ覚書

私の理解度重視のソースコードです。

2019-11-08から1日間の記事一覧

ABC097A - Colorful Transceivers

ABC

問題:A - Colorful Transceivers #include <cstdlib> #include <iostream> using namespace std; int main(void) { int a, b, c, d; cin.tie(0); ios::sync_with_stdio(false); cin >> a >> b >> c >> d; if (abs(a - c) <= d || (abs(a - b) <= d && abs(b - c) <= d)) { cout </iostream></cstdlib>…

ABC096B - Maximum Sum

ABC

問題:B - Maximum Sum #include <algorithm> #include <cmath> #include <iostream> using namespace std; int main(void) { int a, b, c, k; cin.tie(0); ios::sync_with_stdio(false); cin >> a >> b >> c; cin >> k; cout << a + b + c + max(a, max(b, c)) * ((int)pow(2.0, k) - 1) </iostream></cmath></algorithm>…