よじろめ覚書

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

2019-07-06から1日間の記事一覧

ABC034A - テスト

ABC

問題:A - テスト #include <iostream> using namespace std; int main(void) { int x, y; cin.tie(0); ios::sync_with_stdio(false); cin >> x >> y; cout << (x < y? "Better" : "Worse") << "\n"; return 0; } scanfの戻り値とかの考慮が嫌なので、これからはcin, c</iostream>…

ABC033B - 町の合併

ABC

問題:B - 町の合併 #include <cstdio> #include <iostream> #include <string> using namespace std; #define REP(i, n) for (int i = 0; i < (n); ++i) int main(void) { int n, p, sum = 0, max = 0; string s, ans; cin >> n; REP(i, n) { cin >> s >> p; sum += p; if (max < p) {</string></iostream></cstdio>…