よじろめ覚書

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

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

ABC088B - Card Game for Two

ABC

問題:B - Card Game for Two #include <algorithm> #include <functional> #include <iostream> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (n); ++i) #define PB push_back int main(void) { int n, a, ans = 0; vector<int>vec; cin.tie(0); ios::sync_with_stdio(f</int></vector></iostream></functional></algorithm>…

ABC088A - Infinite Coins

ABC

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

ABC087B - Coins

ABC

問題:B - Coins #include <iostream> using namespace std; #define REP(i, n) for (int i = 0; i < (n); ++i) int main(void) { int a, b, c, x, ans = 0; cin.tie(0); ios::sync_with_stdio(false); cin >> a; cin >> b; cin >> c; cin >> x; REP(i, a + 1) { REP(j</iostream>…

ABC087A - Buying Sweets

ABC

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