iterator

#include

for_each 便利そうだけど当分使いそうもない。 template UnaryFunction for_each( InputIterator first, InputIterator last, UnaryFunction f ); template struct increment : public unary_function { //継承してる void operator()(T& x) { x++; } }; //x…

findの使い方

まずはfindから。 string型には、もう定義されてる #include size_type find( const string& str, size_type index = 0 ) const; size_type find( const charT* str, size_type index = 0 ) const; size_type find( const charT* str, size_type index, size…

SRM 471 div2 500

Problem Statement Elly is great fan of consistency. She would like to have order in even the simplest things in life – like listening to music. She has chosen several songs from which she wants to compose a playlist. The names of these son…

#include map, set

mapを使う機会は余りなさそうだけど.よく使う場面が人物(string型)と数字を関連させたい時. table表を作って動的計画法を行なう時とかにも結構大きな効果がある. 一番いいところはtableにすると見やすいところ.そして何より、 //aaaaaaは初めていれる文…

STLコンポーネント

コンテナ vectorとか 汎用アルゴリズム #include 反復子 iterator vector::iterator the_iterator; 関数オブジェクト #inculude アダプタ vector::reverse_iterator rit 割り当て子 allocator イテレータのカテゴリ内容提供元使える演算子 input_iterator(入…