2013-07-13から1日間の記事一覧
問題 http://poj.org/problem?id=2019解法 segment tree の二次元版みたいなやつを作ると各クエリに対してO(log N)で処理できる #include <cstdio> #include <algorithm> using namespace std; typedef pair<int, int> P; const int N_ = 256; const int TREE_SIZE = 87381; // A_1 = 0, A</int,></algorithm></cstdio>…