qeatzy

2015年6月16日

hdu 1034 (preprocess optimization, property of division to avoid if, decreasing order process) 分类: hdoj 2015-06-16 13:32 39人阅读 评论(0) 收藏

摘要: IMO, version 1 better than version 2, version 2 better than version 3. make some preprocess to make you code simple and efficient. Here divide... 阅读全文

posted @ 2015-06-16 13:32 qeatzy 阅读(111) 评论(0) 推荐(0)

hdu 1035 (usage of sentinel, proper utilization of switch and goto to make code neat) 分类: hdoj 2015-06-16 12:33 28人阅读 评论(0) 收藏

摘要: as Scott Meyers said in his book Effective STL, “My advice on choosing among the sorting algorithms is to make your selection based on what y... 阅读全文

posted @ 2015-06-16 12:33 qeatzy 阅读(118) 评论(0) 推荐(0)

2015年6月15日

hdu 1033 (bit masking, utilization of switch, '\0' as end of c string) 分类: hdoj 2015-06-15 21:47 37人阅读 评论(0) 收藏

摘要: bit masking is very common on the lower level code.#include #include #define MAXSIZE 205char line[MAXSIZE];int main() { //freopen("input.tx... 阅读全文

posted @ 2015-06-15 21:47 qeatzy 阅读(147) 评论(0) 推荐(0)

hdu 1031 (partial sort problem, nth_element, stable_partition, lambda expression) 分类: hdoj 2015-06-15 17:47 26人阅读 评论(0) 收藏

摘要: partial sort. first use std::nth_element to find pivot, then use std::stable_partition with the pivot to partition the largest k, whose indice... 阅读全文

posted @ 2015-06-15 17:47 qeatzy 阅读(137) 评论(0) 推荐(0)

hdu 1030 Delta-wave (C++, 0ms, explanatory comments.) 分类: hdoj 2015-06-15 12:21 45人阅读 评论(0) 收藏

摘要: problem description http://acm.hdu.edu.cn/showproblem.php?pid=1030#include #include #include int calPathLength(int x, int y) { //path lengt... 阅读全文

posted @ 2015-06-15 12:21 qeatzy 阅读(133) 评论(0) 推荐(0)

导航