よじろめ覚書

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

2019-10-04から1日間の記事一覧

ABC079A - Good Integer

ABC

問題:A - Good Integer #include <iostream> #include <string> using namespace std; int main(void) { string n; cin.tie(0); ios::sync_with_stdio(false); cin >> n; if ((n[0] == n[1] && n[1] == n[2]) || (n[1] == n[2] && n[2] == n[3])) { cout << "Yes" << "\n"; } </string></iostream>…

ABC078B - ISU

ABC

問題:B - ISU #include <iostream> using namespace std; int main(void) { int x, y, z, cnt = 0; cin.tie(0); ios::sync_with_stdio(false); cin >> x >> y >> z; while (true) { int width = y * cnt + z * (cnt + 1); if (x < width) { cnt--; break; } cnt++; } </iostream>…