よじろめ覚書

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

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

ABC080B - Harshad Number

ABC

問題:B - Harshad Number #include <iostream> using namespace std; int main(void) { int n, copy_n, sum = 0; cin.tie(0); ios::sync_with_stdio(false); cin >> n; copy_n = n; while (copy_n >= 1) { sum += copy_n % 10; copy_n /= 10; } cout << (n % sum == 0</iostream>…

ABC080A - Parking

ABC

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

ABC079B - Lucas Number

ABC

問題:B - Lucas Number #include <iostream> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) int main(void) { int n; long long l[100]; cin.tie(0); ios::sync_with_stdio(false); cin >> n; l[0] = 2; l[1] = 1; FOR(i, 2, n + 1) { </iostream>…