よじろめ覚書

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

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

ABC056B - NarrowRectanglesEasy

ABC

問題:B - NarrowRectanglesEasy #include <cstdlib> #include <iostream> using namespace std; int main(void) { int w, a, b, ans = 0; cin.tie(0); ios::sync_with_stdio(false); cin >> w >> a >> b; if (abs(a - b) > w) { ans = abs(a - b) - w; } cout << ans << "\n"; </iostream></cstdlib>…

ABC056A - HonestOrDishonest

ABC

問題:A - HonestOrDishonest #include <iostream> using namespace std; int main(void) { char a, b; cin.tie(0); ios::sync_with_stdio(false); cin >> a >> b; cout << (a == b? 'H' : 'D') << "\n"; return 0; }</iostream>

ABC055B - Training Camp

ABC

問題:B - Training Camp #include <iostream> using namespace std; #define FOR(i, a, b) for (int i = a; i < (b); ++i) int main(void) { const int MOD = 1e9 + 7; int n; long long ans = 1; cin.tie(0); ios::sync_with_stdio(false); cin >> n; FOR(i, 1, n + </iostream>…