先做好Precalculation

時間複雜度是O(maxN)

再來每次查詢是O(1)

 

http://nopaste.csie.org/0fc14

arrow
arrow
    全站熱搜

    robertanders 發表在 痞客邦 留言(0) 人氣()