よじろめ覚書

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

2019-12-17から1日間の記事一覧

ABC117B - Polygon

ABC

問題:B - Polygon #include <algorithm> #include <iostream> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (n); ++i) int main(void) { int n, l, sum_l = 0, max_l = 0; cin.tie(0); ios::sync_with_stdio(false); cin >> n; REP(i, n) { cin >> l; </vector></iostream></algorithm>…

ABC117A - Entrance Examination

ABC

問題:A - Entrance Examination #include <iostream> #include <iomanip> using namespace std; int main(void) { int t, x; cin.tie(0); ios::sync_with_stdio(false); cin >> t >> x; cout << fixed << setprecision(10) << t / (double)x << "\n"; return 0; }</iomanip></iostream>

ABC116B - Collatz Problem

ABC

問題:B - Collatz Problem #include <iostream> #include <set> using namespace std; int getCollatz(int x_num) { return (x_num % 2)? 3 * x_num + 1 : x_num / 2; } int main(void) { int s, cnt = 0; set<int> se_num; cin.tie(0); ios::sync_with_stdio(false); cin >> s;</int></set></iostream>…