2016年3月14日 星期一

[Codechef IOPC16Q][Math] Bat In Cage

原題連結
這道題....個人覺得比較傳統的數學分析。

[BZOJ 3295][操作分治] 動態逆序對

原題連結
這道題搞了我兩天左右....對於像我一樣沒有對操作分治感受深刻的人的確是比較難做的......
操作分治簡單的例子可以看這裡
code有參考過中國的大神,所以看到很像的code不要驚訝(?

2016年3月13日 星期日

[ZJ b417][莫隊] 區間眾數

原題連結
莫隊算法(Mo's algorithm)這幾年非常的紅啊~~
有很多需要複雜資料結構(LCT , 樹鏈剖分 , 持久化資料結構....) 的題目都可以用莫隊搭配樹壓平之類的技巧作到帶根號的複雜度。

2016年3月11日 星期五

[Wunder Fund Round 2016 pD][DP] Hamiltonian Spanning Tree

link
You can view official tutorial here.
Here I will explain some points I consider important when trying to solve the problem.
There may be some mistakes in grammar due to my poor English QAQ.
Any correction of algorithm or grammar is welcomed.

It's not hard to find that x>y and x<y are two different problem: One is to use more tree edges as possible while the other is to use less tree edges.

2016年3月10日 星期四

[TIOJ 1725][Z algorithm] Massacre at Camp Happy

原題連結
先了解一個問題:給定字串A,B,長度皆為n,要如何線性判定A和B是否只差1個字元呢?

[HDU 4605][Segment Tree] Magic Ball Game

原題連結
嗚姆....這題讓我頗開心的獲得了1A XD

[POI 21st Stage 1][Persistent Segment Tree] Couriers

原題連結
有做過第k小的同學大概對於持久化權值線段樹稍微有點感受

[TIOJ 1735] k-口吃子字串

原題連結
嗚姆....這題還算基本的趣題,我想到兩個作法。

[POI XIII Stage 1][KMP] Periods of Words

原題連結
字串的一題基礎題