Description There are n kangaroos with pockets. Each kangaroo has a size (integer number). A kangaroo can go into another kangaroo's pocket if and only if the size of kangaroo who hold the kangaroo is at least twice as large as the size of kangaroo w…
这个估计是里面第二简单的了,因为第一简单的是求a+b 哈哈,一submit就ac了 题目如下: Description How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We're assuming that the cards must be perpendicular to…
题意,有n只袋鼠,没每只袋鼠有个袋子,大小为si,一个袋鼠可以进入另外一个袋鼠的袋子里面,当且仅当另一个袋鼠的袋子是他的二倍或二倍一上,然后中国袋鼠就是不可见的,不能出现多个袋鼠嵌套的情况.让你求最少可见袋鼠的数量. 解题方法是先排序再贪心,贪心策略是从中间开始贪心. #include <stdio.h> #include <algorithm> const int maxn = 500005; using namespace std; int s[maxn]; int n; in…
Road Construction Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 10141 Accepted: 5031 Description It's almost summer time, and that means that it's almost summer construction time! This year, the good people who are in charge of the r…
[题目] Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers. Note: All numbers will be positive integers. The solution set must not…
我的第一篇博客.. 还不会什么高端的东西就来点基础的. 不用sizeof求int的bit数 //不用sizeof求int的bit数 #include<stdio.h> int main(){ unsigned int i = 1; int n = 0; while(i!=0){ i*=2; n++; } printf("%d\n",n); return 0;}…