2008-11-24から1日間の記事一覧
FloatingMedianとProductOfPricesとUVa 10909で動くのを確認。 template<class T> class BIT{ public: BIT(int n) : n(n), tree(n) {} T read(int idx) { // returns 0 if idx is smaller than 0 T ret = 0; for (; idx >= 0; ret += tree[idx], idx = (idx & (idx + </class>…