2020-01-20から1日間の記事一覧
問題:B - Power Socket #include <iostream> using namespace std; int main(void) { int a, b; cin.tie(0); ios::sync_with_stdio(false); cin >> a >> b; cout << (b - 1 + a - 2) / (a - 1) << "\n"; return 0; }</iostream>
問題:A - Tenki #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, t; cin.tie(0); ios::sync_with_stdio(false); cin >> s; cin >> t; REP(i, s.length()) { if (s[i] </string></iostream>…
問題:B - Resistors in Parallel #include <iomanip> #include <iostream> using namespace std; #define REP(i, n) for (int i = 0; i < (n); ++i) int main(void) { int n, a; double ans = 0.0; cin.tie(0); ios::sync_with_stdio(false); cin >> n; REP(i, n) { cin >> a; </iostream></iomanip>…
問題: #include <iostream> #include <string> using namespace std; int main(void) { int a; string s; cin.tie(0); ios::sync_with_stdio(false); cin >> a; cin >> s; cout << (a < 3200? "red" : s) << "\n"; return 0; }</string></iostream>
問題:B - One Clue #include <iostream> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) int main(void) { int k, x; cin.tie(0); ios::sync_with_stdio(false); cin >> k >> x; FOR (i, x - k + 1, x + k) { cout << i; cout << (i != </iostream>…