Skip to content

Instantly share code, notes, and snippets.

@amoshyc
amoshyc / poj3484.md
Last active August 29, 2015 06:07
Poj 3484: ShowStopper

Poj 3484: ShowStopper

分析

這題不太容易看出來是二分搜…倒是更讓人想到利用 xor。這題另一個難點是 IO , 據說卡 cin/cout,還有這題的題目也不易讀懂啊。

@amoshyc
amoshyc / poj1759.md
Created August 27, 2015 16:16
Poj 1759: Garland

Poj 1759: Garland

分析

我本來想對 B 二分搜,然後反推 H2,之後計算出其它項… 我也真的這麼做了,跑去推 Hi 的通式,但發現 Hi 的通式中含有 (1 + sqrt(8)) ^ i 這種東西…這根本不能用啊

@amoshyc
amoshyc / poj3685.md
Last active August 29, 2015 14:27
Poj 3685: Matrix

Poj 3685: Matrix

分析

跟前一題很類似…poj 3579

我們對 M-th smallest element 二分搜。

@amoshyc
amoshyc / poj3579.md
Last active August 29, 2015 14:27
Poj 3579: Median

Poj 3579: Median

分析

很明顯的,這題不是要你排序然後輸出 median… 所以解法的時間複雜度必優於 O(n^2)

這題既然歸類在二分搜底下,那就從二分搜來思考吧。

@amoshyc
amoshyc / poj3111.md
Created August 17, 2015 14:53
Poj 3111: K best

Poj 3111: K best

分析

平均最大化 => 二分搜

雖說題目寫 S = {i[1], i[2], ..., i[k]},但它所指的是任意選 K 個,而不是選前 K 個

@amoshyc
amoshyc / poj2976.md
Last active August 29, 2015 14:27
Poj 2976: Dropping tests

Poj 2976: Dropping tests

分析

平均最大化 => 二分搜

以下所有的 average 都是指 sum(a) / sum(b) (還未乘以 100

@amoshyc
amoshyc / poj3045.md
Last active August 29, 2015 14:27
Poj 3045: Cow Acrobats

Poj 3045: Cow Acrobats

分析

最大值最小化 => …不是二分搜,卻是 Greedy 啊 (這題也可用二分搜來解,但較慢,可參 ,雖然我是看不太懂啦…)

@amoshyc
amoshyc / poj3104.md
Last active August 29, 2015 14:27
Poj 3104: Drying

Poj 3104: Drying

分析

最大值最小化 => 二分搜

竟然大玩文字陷阱… decreases by k this minute … 這是說 radiator 的烘乾速率是 k-1 per minute

@amoshyc
amoshyc / poj3273.md
Created August 15, 2015 08:06
Poj 3273: Monthly Expense

Poj 3273: Monthly Expense

分析

最大值最小化 => 二分搜

正負相關性判定

@amoshyc
amoshyc / poj3258.md
Last active March 6, 2016 05:53
Poj 3258: River Hopscotch

Poj 3258: River Hopscotch

分析

最小值最大化 => 二分搜

※ 這篇包含了一些個人猜想,有些東西不是那麼確定,未來可能修改