hiho week 147 register

Ended

Participants:514

Verdict:Accepted
Score:100 / 100
Submitted:2017-04-24 00:39:09

Lang:GCC

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<stdio.h>
#include<memory.h>
#define TWO_SIXTEEN 65536
#define USHORT_SHIFT 16
#define USHORT_MASK 65535
#define DATA_SHIFT 5
#define DATA_MASK 31
#define MAX_STUDENT 30000
typedef struct ID_SET{
    unsigned int value[938];
}ID_SET;
ID_SET rank[5][MAX_STUDENT];
unsigned int score[5][MAX_STUDENT];
unsigned int id[5][MAX_STUDENT];
char table_bits16[TWO_SIXTEEN];
char bit_count(unsigned int n){
    char c=0;
    while(n){
        c++;
        n&=(n-1);
    }
    return c;
}
void gen_table_bits16(){
    unsigned int i=0;
    while(i<(TWO_SIXTEEN)){
        table_bits16[i]=bit_count(i);
        i++;
    }
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX