2016-08-01から1ヶ月間の記事一覧
std::copy_backward と std::next を覚えたのでメモ。 #include <bits/stdc++.h> using namespace std; int main() { vector<int> vc{1,2,3,4,5,6,7,8,9,10}; //指定された範囲の要素を後ろからコピーする copy_backward( vc.begin(), vc.begin() + 3, vc.end() ); for( const au</int></bits/stdc++.h>…
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>…
マクロのテンプレートをローカルの普通のメモ帳で管理してたら 間違えて消してしまったので、教えてもらったGitHubのgistにUPしました。 なんて便利なんだ...。 マクロは自分で理解したもののみ、必要になった時に増やしているので、 これからは都度、gistで…
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>…