Tony's Log

Algorithms, Distributed System, Machine Learning

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

2014年2月13日

摘要: 1 line in Ruby(2.0), 36B:p (1..n=gets.to_i).reduce(:*)+2**n-n 阅读全文
posted @ 2014-02-13 15:40 Tonix 阅读(141) 评论(0) 推荐(0)

摘要: Coding a Dijkstra is not hard. %70 of my time spent on tackling TLE, as my last post.Dijkstra works in BFS manner, but at each step, it picks the shortest child greedily and then relax all other neighbors.Data Structure: since there could be up to 10000 cities, storing distance for all pairs of citi 阅读全文
posted @ 2014-02-13 14:35 Tonix 阅读(351) 评论(0) 推荐(0)

摘要: As a solo warrior in OJ, I spent about nearly 50% of my time on tackling TLE - that is innumerous hours. I almost lost my courage to OJ.But thanks to this post:http://www.spoj.com/forum/viewtopic.php?f=3&t=7968. I didn't use all of the hints, but getchar_unlocked works like charms.As advised 阅读全文
posted @ 2014-02-13 14:28 Tonix 阅读(257) 评论(0) 推荐(0)