Tony's Log

Algorithms, Distributed System, Machine Learning

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

2015年4月16日

摘要: Really interesting problem! My 1st solution was DP based, like bottom-up pattern, but it got TLE since it is O(n^2). Then I thought there must be a O(... 阅读全文
posted @ 2015-04-16 14:52 Tonix 阅读(396) 评论(0) 推荐(0)

摘要: Just picture the shifting process in your mind..class Solution {public: int rangeBitwiseAnd(int m, int n) { if (m == n) return m; int... 阅读全文
posted @ 2015-04-16 12:52 Tonix 阅读(117) 评论(0) 推荐(0)

摘要: A coding problem. The trick is, some part of computation can be reused from last iteration. Check out my code:#include #include #include #include #inc... 阅读全文
posted @ 2015-04-16 12:30 Tonix 阅读(316) 评论(0) 推荐(0)

摘要: I tried Python:def f(x,i,n,a,b,r,s,w): if(i>n):return r return f(x,i+1,n,a*x*x,b*2*i*(2*i+s),r+a*w/b,s,-w)n=int(input())for _ in range(n): v=... 阅读全文
posted @ 2015-04-16 10:18 Tonix 阅读(187) 评论(0) 推荐(0)