よじろめ覚書

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

2020-02-01から1ヶ月間の記事一覧

ABC154B - I miss you...

ABC

問題:B - I miss you... #include <iostream> #include <string> using namespace std; #define REP(i, n) for (int i = 0; i < (n); ++i) int main(void) { string s; cin.tie(0); ios::sync_with_stdio(false); cin >> s; REP(i, s.length()) { cout << "x"; if (i == s.len</string></iostream>…

ABC154A - Remaining Balls

ABC

問題:A - Remaining Balls #include <iostream> #include <string> using namespace std; int main(void) { string s, t, u; int a, b; cin.tie(0); ios::sync_with_stdio(false); cin >> s >> t; cin >> a >> b; cin >> u; if (s == u) { --a; } else { --b; } cout << a << </string></iostream>…

ABC153B - Common Raccoon vs Monster

ABC

問題:B - Common Raccoon vs Monster #include <iostream> using namespace std; #define REP(i, n) for (int i = 0; i < (n); ++i) int main(void) { int h, n, a; cin.tie(0); ios::sync_with_stdio(false); cin >> h >> n; REP(i, n) { cin >> a; h -= a; } cout <</iostream>…

ABC153A - Serval vs Monster

ABC

問題:A - Serval vs Monster #include <iostream> using namespace std; int main(void) { int h, a; cin.tie(0); ios::sync_with_stdio(false); cin >> h >> a; cout << (h % a == 0? h / a : h / a + 1) << "\n"; return 0; }</iostream>