Skip to content

Instantly share code, notes, and snippets.

@amoshyc
amoshyc / poj3262.md
Last active October 3, 2015 17:19
Poj 3262: Protecting the Flowers

Poj 3262: Protecting the Flowers

分析

Greedy 策略:d/t 大的先做,也就是 t/d 小的先做。 證明可參 這裡

AC Code

@amoshyc
amoshyc / poj3176.md
Created July 8, 2015 12:56
Poj 3176: Cow Bowling

Poj 3176: Cow Bowling

分析

DP 水題。

dp[row][col] = row, col 以下小三角形的最大和

@amoshyc
amoshyc / poj2229.md
Last active October 4, 2015 02:08
Poj 2229: Sumsets

Poj 2229: Sumsets

分析

完全沒想到啊…

觀察幾個例子:

@amoshyc
amoshyc / poj2385.md
Last active August 29, 2015 14:24
Poj 2385: Apple Catching

Poj 2385: Apple Catching

分析

轉移方程式只想到前半段,後半段沒想到可以這麼做啊

###定義

@amoshyc
amoshyc / poj3616.md
Last active August 29, 2015 14:24
Poj 3616: Milking Time

Poj 3616: Milking Time

分析

想到二維去了…這題用一維 DP 就可以了。

###定義

@amoshyc
amoshyc / poj3280.md
Last active May 13, 2016 05:55
Poj 3280: Cheapest Palindrome

Poj 3280: Cheapest Palindrome

分析

標準二維 dp 的題型。

###定義

@amoshyc
amoshyc / poj1742.md
Last active August 29, 2015 14:24
Poj 1742: Coins

Poj 1742: Coins

分析

多重背包,但須優化。

原始想法會 TLE,時間複雜度為 O(N * M * max(C[i]))

@amoshyc
amoshyc / poj3046.md
Created July 13, 2015 15:17
Poj 3046: Ant Counting

Poj 3046: Ant Counting

分析

也是類背包問題,但變成算方法數。 兩個 Code,第一個是完全照著定義做;第二個是怕會 MLE,改成交互使用 dp 陣列

###定義

@amoshyc
amoshyc / poj3181.md
Created July 14, 2015 03:13
Poj 3181: Dollar Dayz

Poj 3181: Dollar Dayz

分析

背包。且要使用大數。

@amoshyc
amoshyc / poj2010.md
Last active August 29, 2015 14:25
Poj 2010: Moo University - Financial Aid

Poj 2010: Moo University - Financial Aid

分析

Greedy + Priority Queue