Jeffrey&Lynny

一个温馨小家庭的.Net生活

导航

2008年7月8日 #

USACO: Section 1.5 -- PROB Prime Palindromes

摘要: Source Code The key point is that we should generate the palindromes instead of enumerating all the numbers and checking if each one of them is palindrome. Since the numberb as special cases, but th... 阅读全文

posted @ 2008-07-08 17:37 比尔盖房 阅读(366) 评论(0) 推荐(0) 编辑

2008年7月6日 #

USACO: Section 1.5 -- PROB Number Triangles

摘要: Source Code This problem requires us to search all the possible paths. For every level i, the i+1 level has searching choices: f(i+1)=2*f(i). So, for R rows, the final level paths are O(2^R). This c... 阅读全文

posted @ 2008-07-06 10:54 比尔盖房 阅读(298) 评论(0) 推荐(0) 编辑

2008年7月3日 #

USACO: Section 1.4 -- PROB Arithmetic Progressions

摘要: Source Code Lesson Learned: 1. Just as the sorting, searching algorithms, the sequence search(O(N)) < binary search(O(logN)) < bitmap algorithm(O(1)). 2. To boost performance a program, the most po... 阅读全文

posted @ 2008-07-03 13:44 比尔盖房 阅读(415) 评论(0) 推荐(0) 编辑

2008年6月29日 #

USACO: Section 1.3 -- PROB Prime Cryptarithm

摘要: Source Code Lesson Learned: 1. The pseudocode programming is the most important part. Once this part is done correctly, coding is trivial. 2. For the multiply and add math operations, if the opran... 阅读全文

posted @ 2008-06-29 17:00 比尔盖房 阅读(303) 评论(0) 推荐(0) 编辑

2008年6月28日 #

USACO: Section 1.3 -- PROB Barn Repair

摘要: Source code Lession Learned: This is the first non-trivial Gready Algorithm I wrote. It costs a bit of time for me to get it right. For non-trivial algorithm, the pseudocode design&check is really th... 阅读全文

posted @ 2008-06-28 12:17 比尔盖房 阅读(387) 评论(0) 推荐(0) 编辑

USACO: Section 1.3 -- PROB Mixing Milk

摘要: Source Code Lesson Learned: This program algorithm is simple. However, I still meet one problem: edge condition(N, M both are zero). After writting the pseudocode, I should always check algorithm f... 阅读全文

posted @ 2008-06-28 12:07 比尔盖房 阅读(225) 评论(0) 推荐(0) 编辑

2008年6月22日 #

USACO: Section 1.2 -- PROB Dual Palindromes

摘要: Source Code Lesson Learned: Don't be too hurry, verify each statement after coding will save you a lot of time for testing, debugging. 阅读全文

posted @ 2008-06-22 15:26 比尔盖房 阅读(231) 评论(0) 推荐(0) 编辑

2008年6月21日 #

USACO: Section 1.2 -- PROB Palindromic Squares

摘要: Source Code Lesson Learned: 1. Pseudocode is really efficient for designing routines. And please stay calm and write down all the details in pseudocode before coding. 2. During design, all the known... 阅读全文

posted @ 2008-06-21 12:45 比尔盖房 阅读(247) 评论(0) 推荐(0) 编辑

2008年6月14日 #

Programming Pearls: Chatper3 Problem6 [Form letter generator]

摘要: Program source code Lesson Learned: please verify your thought carefully and slowly during pseudocode design, check its correctness is really important... 阅读全文

posted @ 2008-06-14 16:39 比尔盖房 阅读(344) 评论(0) 推荐(0) 编辑

Programming Pearls: Chatper3 Problem5 [Hyphenation Words]

摘要: Program Source Code Lesson Learned: selecting the correct data structure makes coding/algorithm pretty easy. 阅读全文

posted @ 2008-06-14 16:36 比尔盖房 阅读(223) 评论(0) 推荐(0) 编辑