摘要: C++ 1 /** 2 * Definition of TreeNode: 3 * class TreeNode { 4 * public: 5 * int val; 6 * TreeNode *left, *right; 7 * TreeNode(int val... 阅读全文
posted @ 2016-01-06 14:50 ZH奶酪 阅读(294) 评论(0) 推荐(0) 编辑
摘要: C++(1)模运算(百度百科) (a±b)%p = (a%p±b%p)%p (a*b)%p = (a%p*b%p)%p (a^b)%p = ((a%p)^b)%p(2)使用long型(3)magic number 33(4)循环公式class Solution {public: /** ... 阅读全文
posted @ 2016-01-06 14:47 ZH奶酪 阅读(255) 评论(0) 推荐(0) 编辑
摘要: C++ 1 class Solution { 2 public: 3 /** 4 * @param n an integer 5 * @return true if this is a happy number or false 6 */ 7 bool ... 阅读全文
posted @ 2016-01-06 13:59 ZH奶酪 阅读(231) 评论(0) 推荐(0) 编辑