Tony's Log

Algorithms, Distributed System, Machine Learning

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2014年2月9日

摘要: Sorting is not an out-dated topic. My own in-place qsort got TLE... so, I simply called stl::sort() to get AC.This thread explains everything:http://stackoverflow.com/questions/5038895/does-stdsort-implement-quicksortBasic qsort has a worst case of O(n^2) and could result in too deep stack. The late 阅读全文
posted @ 2014-02-09 16:37 Tonix 阅读(167) 评论(0) 推荐(0)

摘要: It is a small fun problem to solve. Since only a max sum is required (no need to print path), we can only keep track of the max value at each line. Basically it is still a human labor simulation work. To be more specifically, we need keep track of a line of max sums.But there are 1000*100 input, so 阅读全文
posted @ 2014-02-09 13:37 Tonix 阅读(430) 评论(0) 推荐(0)

摘要: Just CS rookie practice on DFS\BFS. But details should be taken care of:1. Ruby implementation got TLE so I switched to C++2. There's one space after each output node, including the last one. But SPOJ doesn't clarify it clearly.// 442#include #include #include #include #include using namespa 阅读全文
posted @ 2014-02-09 11:36 Tonix 阅读(314) 评论(0) 推荐(0)