よじろめ覚書

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

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

ABC130B - Bounding

ABC

問題:B - Bounding #include <iostream> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (n); ++i) int main(void) { int n, x, ans = 0; cin.tie(0); ios::sync_with_stdio(false); cin >> n >> x; vector<int> l(n), d(n + 1); d[0] = 0; REP(i,</int></vector></iostream>…

ABC130A - Rounding

ABC

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

ABC129B - Balance

ABC

問題:B - Balance #include <algorithm> #include <iostream> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (n); ++i) int main(void) { const int INF = 1 << 30; int n, ans = INF, sum = 0, part_sum = 0; cin.tie(0); ios::sync_with_stdio(false)</vector></iostream></algorithm>…