제출 #72063

#제출 시각아이디문제언어결과실행 시간메모리
72063 (#118)재채점 전쟁 (FXCUP3_judge)C++17
49 / 100
1576 ms1968 KiB
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;

bool attack[1<<20];
int target[1<<20];

int X,D,C;

char buff[22];

bool ans[555555];

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

    for(int i=0;i<D;i++){
        scanf("%s",buff);
        int cur = 0;
        for(int i=0;i<X;i++) if(buff[i]=='o') cur |= (1<<i);
        attack[cur] = true;
    }

    scanf("%d",&C);
    for(int i=0;i<C;i++){
        scanf("%s",buff);
        int cur = 0;
        for(int i=0;i<X;i++) if(buff[i]=='x') cur |= (1<<i);
        target[cur]++;
    }

    attack[0] = target[0] = 0;

    for(int i=0;i<(1<<X);i++) if(attack[i]){
        for(int j=0;j<(1<<X);j++) if(attack[j]){
            attack[i|j] = true;
        }
    }

    for(int i=0;i<(1<<X);i++) if(attack[i]){
        int cur = 0;
        for(int j=0;j<(1<<X);j++) if(i&j){
            cur += target[j];
        }
        ans[cur] = true;
    }

    for(int i=1;i<=C;i++) if(ans[i]) printf("o"); else printf("x");
    return 0;
}

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

judge.cpp: In function 'int main()':
judge.cpp:34:27: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
     attack[0] = target[0] = 0;
                 ~~~~~~~~~~^~~
judge.cpp:16:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&X);
     ~~~~~^~~~~~~~~
judge.cpp:17:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&D);
     ~~~~~^~~~~~~~~
judge.cpp:20:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%s",buff);
         ~~~~~^~~~~~~~~~~
judge.cpp:26: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("%s",buff);
         ~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...