답안 #72040

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
72040 2018-08-26T04:52:45 Z BBBSNG(#2263, youngyojun, sebinkim, dlalswp25) 재채점 전쟁 (FXCUP3_judge) C++17
0 / 100
2 ms 376 KB
#include <bits/stdc++.h>

using namespace std;

int K[1101010], F[33];
bool ans[505050];
int k, n, m;

int main()
{
	int i, j, s;
	char str[33];
	
	scanf("%d", &k);
	
	scanf("%d", &n);
	
	for(i=1; i<=n; i++){
		scanf("%s", str);
		
		for(s=0, j=0; j<k; j++){
			if(str[j] != '.') s |= (1 << j);
		}
		
		K[s] |= s;
	}
	
	scanf("%d", &m);
	
	for(i=1; i<=m; i++){
		scanf("%s", str);
		
		for(s=0, j=0; j<k; j++){
			if(str[j] != '.') F[j] ++;
		}
	}
	
	for(i=0; i<(1<<k); i++){
		int cnt = 0;
		for(j=0; j<k; j++){
			if(i & (1 << j)){
				K[i] |= K[i - (1 << j)];
				cnt += F[j];
			}
		}
		
		if(K[i] == i) ans[cnt] = 1;
	}
	
	for(i=1; i<=m; i++){
		printf("%c", ans[i]? 'O':'X');
	}
	
	printf("\n");
	
	return 0;
}

Compilation message

judge.cpp: In function 'int main()':
judge.cpp:14:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &k);
  ~~~~~^~~~~~~~~~
judge.cpp:16:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
  ~~~~~^~~~~~~~~~
judge.cpp:19:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s", str);
   ~~~~~^~~~~~~~~~~
judge.cpp:28:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &m);
  ~~~~~^~~~~~~~~~
judge.cpp:31:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s", str);
   ~~~~~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -