よじろめ覚書

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

2020-01-26から1日間の記事一覧

ABC152B - Comparing Strings

ABC

問題:B - Comparing Strings #include <algorithm> #include <iostream> using namespace std; #define REP(i, n) for (int i = 0; i < (n); ++i) int main(void) { char a, b; cin.tie(0); ios::sync_with_stdio(false); cin >> a >> b; REP(i, max(a - '0', b - '0')) { cout <</iostream></algorithm>…

ABC152A - AC or WA

ABC

問題:A - AC or WA #include <iostream> using namespace std; int main(void) { int n, m; cin.tie(0); ios::sync_with_stdio(false); cin >> n >> m; cout << (n == m? "Yes" : "No") << "\n"; return 0; }</iostream>

ABC151B - Achieve the Goal

ABC

問題:B - Achieve the Goal #include <iostream> using namespace std; #define REP(i, n) for (int i = 0; i < (n); ++i) int main(void) { int n, k, m, a, sum = 0; cin.tie(0); ios::sync_with_stdio(false); cin >> n >> k >> m; REP(i, n - 1) { cin >> a; sum </iostream>…

ABC151A - Next Alphabet

ABC

問題:A - Next Alphabet #include <iostream> using namespace std; int main(void) { char c; cin.tie(0); ios::sync_with_stdio(false); cin >> c; cout << (char)(c + 1) << "\n"; return 0; }</iostream>

ABC150B - Count ABC

ABC

問題:B - Count ABC #include <iostream> #include <string> using namespace std; int main(void) { int n, pos = 0, ans = 0; string s; cin.tie(0); ios::sync_with_stdio(false); cin >> n; cin >> s; while (s.find("ABC", pos) != string::npos) { ans++; pos = s.find(</string></iostream>…