C++競プロ学習日記(仮)

( 学習記録であり解説Blogではないです )

幅優先探索(BFS)

ABC007-C 幅優先探索|AtCoder

C: 幅優先探索 - AtCoder Beginner Contest 007 | AtCoder を解きました。 #include <bits/stdc++.h> #define REP(i,n) for(int i=0; i<(n); i++) using namespace std; typedef pair<int, int> PII; struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; const int INF </int,></bits/stdc++.h>…

No.3 ビットすごろく|yukicoder|幅優先探索(BFS)

No.3 ビットすごろく - yukicoder を解きました。 #include <bits/stdc++.h> using namespace std; struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; const int INF = numeric_limits<int>::max(); int f( int N ) { int count{}; while( N > 0 ) { if( N % 2 =</int></bits/stdc++.h>…