제출 #73204

#제출 시각아이디문제언어결과실행 시간메모리
73204test재채점 전쟁 (FXCUP3_judge)C++14
49 / 100
1559 ms188768 KiB
#include<bits/stdc++.h>
using namespace std;

const int MN = 500010;

int X, D, C;
int data[MN], code[MN], 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++) {
        scanf("\n");
        for(int j = 0; j < X; j++) {
            char t; scanf("%c", &t);

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

    scanf("%d", &C);

    for(int i = 0; i < C; i++) {
        scanf("\n");
        for(int j = 0; j < X; j++) {
            char t; scanf("%c", &t);

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

    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");
    }
}

컴파일 시 표준 에러 (stderr) 메시지

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:16:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("\n");
         ~~~~~^~~~~~
judge.cpp:18:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             char t; scanf("%c", &t);
                     ~~~~~^~~~~~~~~~
judge.cpp:25:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &C);
     ~~~~~^~~~~~~~~~
judge.cpp:28:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("\n");
         ~~~~~^~~~~~
judge.cpp:30:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             char t; scanf("%c", &t);
                     ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...