プログラミング道場 ACM/ICPC内検索 / 「安定ソート」で検索した結果

検索 :
  • 安定ソート
    ...,2,0}; //安定ソート  stable_sort( a, a+4 ); // 0,2,3,6, この例は安定であるか無いかが見えないためよろしくない copy( a,a+4, ostream_iterator int (cout,",") ); return 0; }
  • メニュー
    ...た出力 ソートする 安定ソート 順列を作成する 配列の総和 2分検索 特定要素のカウント コンテナへの要素追加 配列の比較 塗りつぶし 要素の検索 部分列の検索 列Aの中に列Bの要素が全て含まれているか 列Aの中に列Bの要素が含まれているか 列に含まれる要素の最大値・最小値 列の反転 集合演算 列の中の連続している要素を消す 関数オブジェクト 参考資料 プログラミングコンテスト 問題の解き方について 幾何学系ライブラリ(complex無し) その他 電子透かし 今週の問題 2006/6/13 先週の問題 2006/6/6 大会のページ 大会一覧 オンラインジャッジ UVa Online Judge PKU Online Judge ZU Online Judge M-Judge リンク ACM-ICPC OB/OG の会 プログラム・プロムナード 地球にやさしいアルゴリズム
  • ソートする
    簡単にソートする ベクターや配列の要素を並び替えます. #include iostream #include algorithm #define N 5 int a[N] = {3, 2, 5, 4, 1}; using namespace std; void print() { for (int i = 0; i N; i++) { cout a[i] " "; } cout endl; } int main() { print(); sort(a, a+N); print(); return 0; }
  • 列の中の連続している要素を消す
    /* template class _FwdIt _FwdIt unique(_FwdIt _First, _FwdIt _Last) template class _FwdIt, class _Pr inline _FwdIt unique(_FwdIt _First, _FwdIt _Last, _Pr _Pred) */ #include algorithm #include iostream using namespace std; int main() { int a[10]; //ソートされている必要は無い //ソートされていた場合は重複する全ての要素が消える for( int i = 1, j = 0; i = 4; ++i ) for( int k = 0; k i; ++k ) a[j++] = i; // 1,2,2,3,3,3,4,4,4...
  • 2分検索
    /* template class _FwdIt, class _Ty bool binary_search(_FwdIt _First, _FwdIt _Last, const _Ty _Val) template class _FwdIt, class _Ty, class _Pr bool binary_search(_FwdIt _First, _FwdIt _Last,const _Ty _Val, _Pr _Pred) */ #include algorithm #include iostream #include functional using namespace std; int main() { //ソートされている必要がある int a[] = {1,2,4,7,9}; //true cout ( binary_search(a,...
  • 順列を作成する
    順列を簡単に作成する ベクターや配列の要素を並び替えて順列を作ります. #include iostream #include algorithm #define N 5 int a[N] = {1, 2, 3, 4, 5}; using namespace std; int main() { //aは初期状態においてソートされている必要がある do { for (int i = 0; i N; i++) { cout a[i] " "; } cout endl; } while ( next_permutation( a, a+N ) ); return 0; }
  • 列Aの中に列Bの要素が全て含まれているか
    /* template class _InIt1, class _InIt2 bool includes( _InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2) template class _InIt1, class _InIt2, class _Pr bool includes( _InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _Pr _Pred ) */ #include algorithm #include iostream #include functional using namespace std; int main() { //対象となる列はソートされていなければいけない int a[] = {1,4,9}...
  • 集合演算
    /* template class _InIt1, class _InIt2, class _OutIt _OutIt set_union( _InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest ) template class _InIt1, class _InIt2, class _OutIt, class _Pr _OutIt set_union( _InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest, _Pr _Pred ) template class _InIt1, class _InIt2, class _OutIt _OutIt set_intersection( _InIt...
  • 国内予選 2008
    国内予選2008 問題 Problem A Equal Total Scores 等しい合計点 A_tk.cpp Problem B Monday-Saturday Prime Factors 月曜土曜素因数 B_tk.cpp Problem C How can I satisfy thee? Let me count the ways... 如何に汝を満足せしめむ? いざ数え上げむ… C_tk3.c シンプルイズザベスト。某ソースに触発されて作成。46行。 C_tk.cpp LLパーサで項の値27通りすべてを列挙しながら最終的な値を求める C2_tk.cpp 文字列置換によって式を3値に還元する C.c 3行。231byte。 Problem D Twirling Robot ちょろちょろロボット D_tk.cpp 位置と向きで拡張ダイク...
  • トップページ
    プログラミング道場のwiki(仮)です. ACM/ICPCの問題を解くために役立つものとかを書いていく予定です.自分で更新する場合も自由に行ってください. 2008年に復活。主に問題を解いたソースコードを蓄積していく予定? プログラミング道場とは プログラミング道場はACM/ICPCの参加を目標として行われているプログラミングの練習会のようなものです.基本的には毎週火曜日の8限目(16 45)から19時くらいまで7号館で行われています.
  • @wiki全体から「安定ソート」で調べる

更新順にページ一覧表示 | 作成順にページ一覧表示 | ページ名順にページ一覧表示 | wiki内検索

目安箱バナー