hiho Week 8 register

Ended

Participants:541

Verdict:Accepted
Score:100 / 100
Submitted:2014-08-24 17:02:59

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "iostream"
#include "algorithm"
#include "cstdio"
#include "cstring"
#include "set"
#include "vector"
using namespace std;
int dp[2][1<<10];
int cnt[1<<10];
int num[1010];
int N,M,Q;
int reans(int pos,int flag){
    int v = pos>>1;
    if(cnt[v]<Q)
        return max(dp[flag][v+(1<<(M-1))],dp[flag][v]);
    if(cnt[v]==Q)
        return dp[flag][v];
}
int recnt(int x){
    int cntx=0;
    while(x){
        if(x&1)cntx+=1;
        x>>=1;
    }
    return cntx;
}
int main()
{
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX