close

先做好Precalculation

時間複雜度是O(maxN)

再來每次查詢是O(1)

 

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

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 robertanders 的頭像
    robertanders

    Robert Anderson's Blog

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