摘要: //的确不用判断x与y的大小关系 int gcd(int x,int y){ if(y==0) return x; return gcd(y,x%y); } bool hasGroupsSizeX(int* deck, int deckSize){ if (deck == NULL || deckS 阅读全文
posted @ 2020-08-25 18:48 温暖了寂寞 阅读(160) 评论(0) 推荐(0) 编辑
摘要: double* twoSum(int n, int* returnSize){ int dp[15][70] = {0}; //赋予初始值,只有一个骰子的时候1到6出现的频率均为1 for (int i = 1; i <= 6; i ++) { dp[1][i] = 1; } //从两个骰子的情况开 阅读全文
posted @ 2020-08-25 13:33 温暖了寂寞 阅读(203) 评论(0) 推荐(0) 编辑
摘要: int add(int a, int b){ while(a!=0){ int temp=a^b; a=((unsigned int)(a&b)<<1); b=temp; } return b; } 阅读全文
posted @ 2020-08-25 08:59 温暖了寂寞 阅读(136) 评论(0) 推荐(0) 编辑