よじろめ覚書

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

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

ABC150A - 500 Yen Coins

ABC

問題:A - 500 Yen Coins #include <iostream> using namespace std; int main(void) { int k, x; cin.tie(0); ios::sync_with_stdio(false); cin >> k >> x; cout << (x <= k * 500? "Yes" : "No") << "\n"; return 0; }</iostream>

ABC149B - Greedy Takahashi

ABC

問題:B - Greedy Takahashi #include <iostream> using namespace std; int main(void) { long long a, b, k; cin.tie(0); ios::sync_with_stdio(false); cin >> a >> b >> k; a -= k; if (a < 0) { b += a; if (b < 0) { b = 0; } a = 0; } cout << a << " " << b <<</iostream>…

ABC149A - Strings

ABC

問題:A - Strings #include <iostream> #include <string> using namespace std; int main(void) { string s, t; cin.tie(0); ios::sync_with_stdio(false); cin >> s >> t; cout << t + s << "\n"; return 0; }</string></iostream>

ABC148B - Strings with the Same Length

ABC

問題:B - Strings with the Same Length #include <iostream> #include <string> using namespace std; #define REP(i, n) for (int i = 0; i < (n); ++i) int main(void) { int n; string s, t; cin.tie(0); ios::sync_with_stdio(false); cin >> n; cin >> s >> t; REP(i, n</string></iostream>…

ABC148A - Round One

ABC

問題:A - Round One #include <iostream> using namespace std; int main(void) { int a, b; cin.tie(0); ios::sync_with_stdio(false); cin >> a >> b; cout << 6 - a - b << "\n"; return 0; }</iostream>

ABC147B - Palindrome-philia

ABC

問題:B - Palindrome-philia #include <iostream> #include <string> using namespace std; #define REP(i, n) for (int i = 0; i < (n); ++i) int main(void) { int ans = 0; string s; cin.tie(0); ios::sync_with_stdio(false); cin >> s; REP(i, s.length() / 2) { if (i </string></iostream>…

ABC147A - Blackjack

ABC

問題:A - Blackjack #include <iostream> using namespace std; int main(void) { int a1, a2, a3; cin.tie(0); ios::sync_with_stdio(false); cin >> a1 >> a2 >> a3; cout << (a1 + a2 + a3 <= 21? "win" : "bust") << "\n"; return 0; }</iostream>