2013-01-01から1年間の記事一覧

gnuplot と AsukaHistory による距離時間グラフの作り方

目的 アスカTAの冒険を視覚的に分析するために、縦軸に距離、横軸に時間を取った距離時間グラフを作りたい。 AsukaTools の AsukaHistory を使えば階層と時間をファイルに記録してくれるので、これを利用できる。 準備 主は表計算を使うスキルがないので、グ…

Transcription: Skull Bones

頭の骨の名前を覚えよう。 The human skull is made up of eight cranial bones that surround and protect the brain, and fourteen facial bones that form the underlying structure of the face and support for the teeth. With the exception of the m…

adjacent_difference

なるほど、partial_sum したものに adjacent_difference をかけると元に戻ると。プロジェクトオイラーで使えないかな。 int main() { int tmp[] = { 1, 1, 1, 1, 1 }; vector<int> vi(&tmp[0], &tmp[5]); DEBUG_PRINT(vi); cout << "partial_sum" << endl; partia</int>…

make_heap, push_heap, pop_heap, sort_heap

ヒープは一揃いの関数として提供されていてvectorのようにクラスになっていない。vectorを利用してヒープを作るクラスを作ってみた。いまいち使い道がわからない。 ザ・コード! #include <iostream> #include <algorithm> #include <vector> #include <list> using namespace std; #define DEBU</list></vector></algorithm></iostream>…

partial_sumっていつ使うの?

コード int main() { string tmp[5] = {"ぼ", "くは", "お", "にぎりが", "食べたいんだな"}; vector<string>vs(5); partial_sum(tmp, &tmp[5], vs.begin()); DEBUG_PRINT(vs); } 出力 vs == [ぼ, ぼくは, ぼくはお, ぼくはおにぎりが, ぼくはおにぎりが食べたいんだ</string>…