转载请注明原文地址:http://www.cnblogs.com/ygj0930/p/6409067.html 1:Hamming distance The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calculate the Hamming distance.…
Coding everyday. ^_^ 1. Two Sum 重点知识:指针可以存储数值,通过 malloc 新建数组 int* returnSize:Size of the return array. Store the value in a pointer, say 2.*returnSize = 2 My solution: /** * Note: The returned array must be malloced, assume caller calls free(). */ in…
链接:https://www.luogu.org/problem/lists?name=&orderitem=pid&tag=83%2C30 D1T1:转圈游戏(circle) 题意:看题目.. 解题思路:快速幂求\( (10^k m) mod n \)即可.时间效率\( O (\lg k) \) #include<stdio.h> #define ll long long #define For(i,a,b) for(int i=a; i<=b; i++) #defin…
转载请注明原文地址: 21:Assign Cookies Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the minimum size of a cookie that the child wi…