2011-10-01から1ヶ月間の記事一覧

下のやつの追記

C++

結局、なんでこれがだめかっていうのを調べたり考えたりした。 2つのテンプレートの定義T1とT2があった時に、もしT1がT2をspecializationしたものならばT1 >= T2っていう順序関係ををテンプレートの定義全体の集合Tについて考える。 テンプレートを使うとき…

たまにやってしまうあれ

C++

なんかおしゃれにテンプレート使っちゃうぞー、とかする時にたまにあるあれです。 どうなるんだったか、頻繁に忘れるのでメモ。 #include <iostream> using namespace std; template<class T,int n> class Array { T data[n]; public: T get(int idx); void set(T v,int idx); }; // s</class></iostream>…

emacs24 で ProofGeneral 使うときのメモ

Coq

ずっとtrunkのemacsを自分でビルドして使ってるわけなんですが、ProofGeneralを使おうとして、byte-compileしようとするとこけます。 で、エラーメッセージを読むと interactive-p を使うな、 called-interactively-p を使えとあるので (interactive-p)を探…

今日学んだこと

なんか実験で並列プログラミングとかいうのをやっていて、並列化する前に逐次実行のコードを速くしようとしてるんですけど、そういうことほとんどしたことないし、よくわからないですね。 とりあえず、ループの順番入れ替えるとかなんとかしてキャッシュミス…

SRM520 Div1 500

算数力が足りなくて、組合せが求められない。以下のコードは、間違っています #include <cmath> #include <ctime> #include <iostream> #include <string> #include <vector> #include <cstdlib> #include <cstdio> #include <map> #include <queue> #include <algorithm> #include <cstring> using namespace std; typedef long long ll; ll dp[50][200</cstring></algorithm></queue></map></cstdio></cstdlib></vector></string></iostream></ctime></cmath>…