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…
题意,有n只袋鼠,没每只袋鼠有个袋子,大小为si,一个袋鼠可以进入另外一个袋鼠的袋子里面,当且仅当另一个袋鼠的袋子是他的二倍或二倍一上,然后中国袋鼠就是不可见的,不能出现多个袋鼠嵌套的情况.让你求最少可见袋鼠的数量. 解题方法是先排序再贪心,贪心策略是从中间开始贪心. #include <stdio.h> #include <algorithm> const int maxn = 500005; using namespace std; int s[maxn]; int n; in…
As most of the ACMers, wy's next target is algorithms, too. wy is clever, so he can learn most of the algorithms quickly. After a short time, he has learned a lot. One day, mostleg asked him that how many he had learned. That was really a hard proble…
Illegal spices 题目连接: http://acm.timus.ru/problem.aspx?space=1&num=1995 Description Jabba: Han, my boy, you disappoint me. Why haven't you paid me? And why did you fry poor Greedo? Han: Look, Jabba, next time you wanna talk to me, come see me yourself…