답안 #68993

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
68993 2018-08-19T12:20:14 Z imsifile 재채점 전쟁 (FXCUP3_judge) C
0 / 100
2 ms 248 KB
#include<stdio.h>

int X, D, C;
int ors[1<<20], usr[1<<20], bm;
char st[22], chk[505050];

int main(){
	scanf("%d", &X); bm=(1<<X)-1;
	scanf("%d", &D);
	for(int i=D; i--;){
		scanf("\n%s", st);
		int su=0;
		for(int j=0; j<X; j++) if(st[j]=='o') su|=1<<j;
		ors[su]=su;
	}
	scanf("%d", &C);
	for(int i=C; i--;){
		chk[i+1]='x';
		scanf("\n%s", st);
		int su=0;
		for(int j=0; j<X; j++) if(st[j]=='.') su|=1<<j;
		usr[su]++;
	}
	for(int i=0; i<X; i++){
		for(int j=0; j<bm; j++){
			if(j&(1<<i)) continue;
			ors[j^(1<<i)] |= ors[j];
			usr[j^(1<<i)] += usr[j];
		}
	}
	for(int j=0; j<=bm; j++) if(ors[j]==j) chk[C-usr[bm^j]]='o';
	puts(chk+1);
	return 0;
}

Compilation message

judge.c: In function 'main':
judge.c:8:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &X); bm=(1<<X)-1;
  ^~~~~~~~~~~~~~~
judge.c:9:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &D);
  ^~~~~~~~~~~~~~~
judge.c:11:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   scanf("\n%s", st);
   ^~~~~~~~~~~~~~~~~
judge.c:16:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &C);
  ^~~~~~~~~~~~~~~
judge.c:19:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   scanf("\n%s", st);
   ^~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 248 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 248 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 248 KB Output isn't correct
2 Halted 0 ms 0 KB -