原題連結
剛好最近作到一些類似的問題,所以這題的核心思想我是矇中的(?
2016年3月15日 星期二
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.
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日 星期四
2016年2月28日 星期日
2016年2月22日 星期一
2016年2月21日 星期日
[Codeforces Round #313 (Div. 1) pC][DP] Gerald and Giant Chess
原題連結
本來一直往dp[i][j]=dp[i-1][j]+dp[i][j-1]去想......結果不管怎麼弄都逃離不了O(n^2)XD
最後看了codeforces上的tag寫著combinatorics!
才突然想起高中數學也有教,從(0,0)走到(n,m)的捷徑方法數是C(n+m,m),這是解這題的其中一個關鍵
本來一直往dp[i][j]=dp[i-1][j]+dp[i][j-1]去想......結果不管怎麼弄都逃離不了O(n^2)XD
最後看了codeforces上的tag寫著combinatorics!
才突然想起高中數學也有教,從(0,0)走到(n,m)的捷徑方法數是C(n+m,m),這是解這題的其中一個關鍵
2016年2月20日 星期六
2016年2月5日 星期五
2016年1月31日 星期日
2016年1月28日 星期四
訂閱:
文章 (Atom)