题目链接 题意: 给定goal和limit,求1-limit中的若干个数,每一个数最多出现一次,且这些数的lowbit()值之和等于goal,假设存在这种一些数,输出个数和每一个数:否则-1 分析: 先考虑一下比較普通的情况,给一些数,和一个goal,问时候能达到.(最好还是设这些数已经从大到小排序) 考虑能否够贪心,对于当前的数x: 1.之后的数的和能等于x,那么假设x<=goal,显然必须选x: 2.之后的数的和能等于x-1,那么同上(这个情况就是二进制的情况) 3.之后的数的和不包含上述两…
D. The Child and Sequence Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/438/problem/D Description At the children's day, the child came to Picks's house, and messed his house up. Picks was angry at him. A lot of important…
B. The Child and Zoo Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/438/problem/B Description Of course our child likes walking in a zoo. The zoo has n areas, that are numbered from 1 to n. The i-th area contains ai animal…
A. The Child and Toy Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/438/problem/A Description On Children's Day, the child got a toy from Delayyy as a present. However, the child is so naughty that he can't wait to destroy…
题目链接:http://codeforces.com/problemset/problem/438/D 给你n个数,m个操作,1操作是查询l到r之间的和,2操作是将l到r之间大于等于x的数xor于x,3操作是将下标为k的数变为x. 注意成段更新的时候,遇到一个区间的最大值还小于x的话就停止更新. #include <iostream> #include <cstdio> #include <cstring> using namespace std; typedef __…
     好题啊,被HACK了.曾经做题都是人数越来越多.这次比赛 PASS人数 从2000直掉 1000人  被HACK  1000多人! ! ! ! 没见过的科技啊 1 2 4 8 这组数 被黑的 A. The Child and Homework time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Once upon a ti…
D. The Child and Sequence time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output At the children's day, the child came to Picks's house, and messed his house up. Picks was angry at him. A lot of…
D. The Child and Sequence time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output At the children's day, the child came to Picks's house, and messed his house up. Picks was angry at him. A lot of…
D. The Child and Zoo time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Of course our child likes walking in a zoo. The zoo has n areas, that are numbered from 1 to n. The i-th area contains …
B. The Child and Set   At the children's day, the child came to Picks's house, and messed his house up. Picks was angry at him. A lot of important things were lost, in particular the favorite set of Picks. Fortunately, Picks remembers something about…