hiho week 30 register

Ended

Participants:387

Verdict:Accepted
Score:100 / 100
Submitted:2015-01-27 21:29:20

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<cstdio>
int getInt() {
    int aa;
    char ch;
    while (ch = getchar(), ch < '0' || ch > '9')
        ;
    aa = ch - 48;
    while (ch = getchar(), ch >= '0' && ch <= '9')
        aa = aa * 10 + ch - '0';
    return aa;
}
enum GridState {
    kGridNotMine = 0, kGridIsMine, kStateUnknown
};
int main() {
    int test_case_count = getInt();
    for (int case_index = 0; case_index != test_case_count; ++case_index) {
        int col_count = getInt();
        int *numbers = new int[col_count];
        for (int col = 0; col != col_count; ++col)
            numbers[col] = getInt();
        GridState *states[2];
        bool legal[2] = { true, true };
        for (int cas = 0; cas < 2; ++cas) {
            states[cas] = new GridState[col_count];
            states[cas][0] = static_cast<GridState>(cas);
            int mine_count = cas;
            for (int col = 0; col != col_count - 1; ++col) {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX