답안 #73205

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
73205 2018-08-28T04:40:43 Z test 재채점 전쟁 (FXCUP3_judge) C++14
100 / 100
1235 ms 187704 KB
#include<bits/stdc++.h>
using namespace std;

const int MN = 500010;

int X, D, C;
int cnt1[1 << 20], cnt2[1 << 20];
int dp1[1 << 20][22], dp2[1 << 20][22];
int ans[MN];

int main() {
    scanf("%d", &X);
    scanf("%d", &D);

    for(int i = 0; i < D; i++) {
        getchar();
        int mask = 0;
        for(int j = 0; j < X; j++) {
            char t = getchar();

            if(t == 'o') mask ^= (1 << j);
        }
        cnt1[mask]++;
    }

    scanf("%d", &C);

    for(int i = 0; i < C; i++) {
        getchar();
        int mask = 0;
        for(int j = 0; j < X; j++) {
            char t = getchar();

            if(t == 'x') mask ^= (1 << j);
        }
        cnt2[mask]++;
    }

    for(int i = 0; i < (1 << X); i++) {
        dp1[i][X] = cnt1[i]? i : 0;
        dp2[i][X] = cnt2[i];
    }
    for(int i = X - 1; i >= 0; i--) {
        for(int j = 0; j < (1 << X); j++) {
            if(j & (1 << i)) {
                dp1[j][i] |= dp1[j][i + 1];
                dp1[j][i] |= dp1[j ^ (1 << i)][i + 1];
                dp2[j][i] += dp2[j][i + 1];
                dp2[j][i] += dp2[j ^ (1 << i)][i + 1];
            }
            else {
                dp1[j][i] |= dp1[j][i + 1];
                dp2[j][i] += dp2[j][i + 1];
            }
        }
    }

    for(int i = 0; i < (1 << X); i++) {
        if(dp1[i][0] == i) {
            ans[ C - dp2[(1 << X) - 1 - i][0] ] = 1;
        }
    }
    for(int i = 1; i <= C; i++) {
        if(ans[i]) printf("o");
        else printf("x");
    }
}

Compilation message

judge.cpp: In function 'int main()':
judge.cpp:12:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &X);
     ~~~~~^~~~~~~~~~
judge.cpp:13:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &D);
     ~~~~~^~~~~~~~~~
judge.cpp:26:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &C);
     ~~~~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 560 KB Output is correct
4 Correct 14 ms 6192 KB Output is correct
5 Correct 16 ms 6268 KB Output is correct
6 Correct 12 ms 6392 KB Output is correct
7 Correct 13 ms 6392 KB Output is correct
8 Correct 13 ms 6392 KB Output is correct
9 Correct 11 ms 6392 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 560 KB Output is correct
4 Correct 14 ms 6192 KB Output is correct
5 Correct 16 ms 6268 KB Output is correct
6 Correct 12 ms 6392 KB Output is correct
7 Correct 13 ms 6392 KB Output is correct
8 Correct 13 ms 6392 KB Output is correct
9 Correct 11 ms 6392 KB Output is correct
10 Correct 61 ms 6392 KB Output is correct
11 Correct 46 ms 6392 KB Output is correct
12 Correct 12 ms 6392 KB Output is correct
13 Correct 14 ms 6496 KB Output is correct
14 Correct 105 ms 6516 KB Output is correct
15 Correct 148 ms 7028 KB Output is correct
16 Correct 234 ms 7028 KB Output is correct
17 Correct 218 ms 7052 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 560 KB Output is correct
4 Correct 14 ms 6192 KB Output is correct
5 Correct 16 ms 6268 KB Output is correct
6 Correct 12 ms 6392 KB Output is correct
7 Correct 13 ms 6392 KB Output is correct
8 Correct 13 ms 6392 KB Output is correct
9 Correct 11 ms 6392 KB Output is correct
10 Correct 61 ms 6392 KB Output is correct
11 Correct 46 ms 6392 KB Output is correct
12 Correct 12 ms 6392 KB Output is correct
13 Correct 14 ms 6496 KB Output is correct
14 Correct 105 ms 6516 KB Output is correct
15 Correct 148 ms 7028 KB Output is correct
16 Correct 234 ms 7028 KB Output is correct
17 Correct 218 ms 7052 KB Output is correct
18 Correct 363 ms 47500 KB Output is correct
19 Correct 546 ms 91500 KB Output is correct
20 Correct 1203 ms 186756 KB Output is correct
21 Correct 1113 ms 186756 KB Output is correct
22 Correct 1234 ms 187704 KB Output is correct
23 Correct 1235 ms 187704 KB Output is correct