2020-03-01から1ヶ月間の記事一覧

AtCoder ABC 159 復習メモ

A - The Number of Even Pairs えっ、難しい… 天地開闢以来最も意味がわからないと話題に (頭がA問題だったので…) 人類の希望、サンプルエスパーに全てを託しますというわけで入力例4に的を絞り 13, 3からなんとか81を捻り出せないか 5分ほど考えていたらな…

パナソニックプログラミングコンテスト2020 復習メモ

A - Kth Term こんな問題でも本番だと結構あたふたしてしまいます #include <bits/stdc++.h> using namespace std; int main() { vector<int> V = { 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51 }; int K; cin >> K; co</int></bits/stdc++.h>…

AtCoder ABC 158 復習メモ

A - Station and Bus よくわからないですがサンプルを見るに uniqueしてサイズが1じゃなければ "Yes" すればよさそうです。ほんまか #include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; S.erase(unique(S.begin(), S.end()), S.end()); cout <</bits/stdc++.h>…

AtCoder ABC 157 復習メモ

A - Duplex Printing えっ、難し…く、ない? (A + B - 1) / B で A を B で切り上げて割り算できるそうなのでそうしました #include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; cout << (N + 2 - 1) / 2 << "\n"; } ABC153のA問題と同じ問題でし</bits/stdc++.h>…