2018-09-27から1日間の記事一覧

Peking University Online Judge 2409 Let It Bead

昨日のコードを少しだけ弄ってAC #include<cstdio> #include<vector> using namespace std; typedef long long int ll; static const int MAX_CS = 32; int c, s; vector<ll> va[MAX_CS + 1]; int gcd(int a, int b){ if(b == 0) return a; else return gcd(b, a % b); } int mai</ll></vector></cstdio>…

Peking University Online Judge 1286 Necklace of Beads

テストケースに0を忍ばせるとかいうアレ ポリアの数え上げ定理を使いましたが、反転のパートは想像で書きました(バカなの?) #include<cstdio> #include<vector> using namespace std; typedef long long int ll; int n; vector<ll> va; int gcd(int a, int b){ if(b == 0) ret</ll></vector></cstdio>…