摘要:
1 typedef unsigned int uint32_t; 2 class Solution { 3 public: 4 int hammingWeight(uint32_t n) { 5 int tot=0; 6 while(n) 7 ... 阅读全文
摘要:
1 int dp[1000000]; 2 class Solution { 3 public: 4 int rob(vector& nums) { 5 int i,n=nums.size(); 6 if(n==0) 7 return ... 阅读全文
摘要:
1 class Solution { 2 public: 3 bool isHappy(int n) { 4 int dig[1000],cnt,ans; 5 memset(dig,0,sizeof(dig)); 6 while(1) 7 ... 阅读全文
摘要:
1 class Solution { 2 public: 3 ListNode* removeElements(ListNode* head, int val) { 4 ListNode*cur,*nxt,*pre=head; 5 if(head==NULL... 阅读全文
摘要:
1 int ary[1500005]; 2 class Solution { 3 public: 4 int countPrimes(int n) { 5 int i,j; 6 memset(ary,0,sizeof(ary)); 7 int... 阅读全文