PIXNET Logo登入

Robert Anderson's Blog

跳到主文

The memory of my way to my dream.

部落格全站分類:數位生活

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 7月 23 週四 200909:44
  • PKU - 3173 Parkside's Triangle

蠻簡單的一題
不過蠻有趣的
觀察出規律就可以輕鬆寫出了
 

(繼續閱讀...)
文章標籤

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

  • 個人分類:PKU
▲top
  • 7月 22 週三 200921:09
  • PKU - 2186 Popular Cows

先求SCC
再來你要求是不是有一個group
可以被其他所有groups到達
一開始我想太複雜

(繼續閱讀...)
文章標籤

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

  • 個人分類:PKU
▲top
  • 7月 22 週三 200915:46
  • PKU - 1950 Dessert

DFS搜尋
State只有3^(N-1)種
最大N = 15
所以可以通過

(繼續閱讀...)
文章標籤

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

  • 個人分類:PKU
▲top
  • 7月 22 週三 200915:00
  • PKU - 2140 Herd Sums

推導出公式
L(2a + L - 1)/2 = N
=>L(2a + L - 1) = 2N
故對2N相除

(繼續閱讀...)
文章標籤

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

  • 個人分類:PKU
▲top
  • 7月 21 週二 200918:15
  • 程式設計 - Heuristic Problem

Idea #1: Heuristic Pruning
The easiest and most common use for heuristic functions is to prune
the search space. Assume the problem is to find the solution with the
minimum total cost. With an admissible heuristic function, if the cost
of the current solution thus far is A, and the heuristic function returns
B, then the best possible solution which is a child of the current
solution is A+B. If the a solution has been found with cost C, where C
< A+B, there is no reason to continue searching for a solution from
this state.

(繼續閱讀...)
文章標籤

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

  • 個人分類:程式設計
▲top
  • 7月 21 週二 200911:01
  • PKU - 2000 Gold Coins

先做好Precalculation
時間複雜度是O(maxN)
再來每次查詢是O(1)
 

(繼續閱讀...)
文章標籤

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

  • 個人分類:PKU
▲top
  • 7月 21 週二 200910:40
  • PKU - 3075 Tic-Tac-Toe

判斷有點多
以下說明有哪些不合法情況
 
1.數量不對型

(繼續閱讀...)
文章標籤

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

  • 個人分類:PKU
▲top
  • 7月 21 週二 200909:40
  • PKU - 3094 Quicksum

很簡單的一題
如果你用其他方法做(應該都比較麻煩)
還得注意是不是中間有一堆空白(茶)
 

(繼續閱讀...)
文章標籤

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

  • 個人分類:PKU
▲top
  • 7月 21 週二 200909:20
  • PKU - 2739 Sum of Consecutive Prime Numbers

先找出1 - 10000的質數
再來就是求Consecutive的Sum
用一個table去紀錄結果
這樣看來時間複雜度約O( primes.size() ^ 2 )

(繼續閱讀...)
文章標籤

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

  • 個人分類:PKU
▲top
  • 7月 21 週二 200909:02
  • PKU - 2081 Recaman's Sequence

先預算好所有答案
因為他規定number不能recurring
所以可以在自己電腦裡面看table要開多大
 

(繼續閱讀...)
文章標籤

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

  • 個人分類:PKU
▲top
«1...56711»

個人資訊

robertanders
暱稱:
robertanders
分類:
數位生活
好友:
累積中
地區:

熱門文章

  • ()USACO Mother's Milk
  • ()ACM 305 - Joseph
  • ()程式設計 - Bellman-Ford algorithm
  • ()程式設計 - Minimum Cost Maximum Flow
  • ()ACM 10032 - Tug of War
  • ()ACM 254 - Towers of Hanoi
  • ()ACM 11475 - Extend to Palindrome
  • ()ACM 10298 - Power Strings
  • ()ACM 10245 - The Closest Pair Problem
  • ()ACM 10181 - 15-Puzzle Problem

文章分類

  • 程式設計講義 (2)
  • 歌 (2)
  • 程式設計 (9)
  • 其他資訊題目 (4)
  • ACM (21)
  • PKU (50)
  • USACO (21)
  • 未分類文章 (1)

最新文章

    文章精選

    文章搜尋

    誰來我家

    參觀人氣

    • 本日人氣:
    • 累積人氣: