このアルゴリズムは,最後の列におけるいずれかのpos位置に対して,元の列の(pos−malache[pos]+2)/2−1位置に対応し,長さはmalache[pos]−1である.
これにより,すべての返信位置を直接求めることが容易になる.
テンプレートは前の文章のテンプレートを使っています
/*
#include
#include
#include
#include
using std::tr1::unordered_map;
*/
#include
#include
#include
#include
#include
#include