답안 #72054

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
72054 2018-08-26T05:00:43 Z imsifile 재채점 전쟁 (FXCUP3_judge) C++
49 / 100
1500 ms 2456 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]=='x') su|=1<<j;
		usr[su]++;
	}
	for(int i=bm; i>=0; i--){
		for(int j=0; j<i; j++){
			if((i^bm)&j) continue;
			ors[i] |= ors[j];
			usr[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.cpp: In function 'int main()':
judge.cpp:8:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &X); bm=(1<<X)-1;
  ~~~~~^~~~~~~~~~
judge.cpp:9:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &D);
  ~~~~~^~~~~~~~~~
judge.cpp:11:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("\n%s", st);
   ~~~~~^~~~~~~~~~~~
judge.cpp:16:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &C);
  ~~~~~^~~~~~~~~~
judge.cpp:19:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("\n%s", st);
   ~~~~~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 3 ms 496 KB Output is correct
4 Correct 547 ms 756 KB Output is correct
5 Correct 603 ms 1004 KB Output is correct
6 Correct 664 ms 1004 KB Output is correct
7 Correct 548 ms 1004 KB Output is correct
8 Correct 538 ms 1004 KB Output is correct
9 Correct 578 ms 1004 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 3 ms 496 KB Output is correct
4 Correct 547 ms 756 KB Output is correct
5 Correct 603 ms 1004 KB Output is correct
6 Correct 664 ms 1004 KB Output is correct
7 Correct 548 ms 1004 KB Output is correct
8 Correct 538 ms 1004 KB Output is correct
9 Correct 578 ms 1004 KB Output is correct
10 Correct 83 ms 1740 KB Output is correct
11 Correct 70 ms 1740 KB Output is correct
12 Correct 17 ms 1740 KB Output is correct
13 Correct 588 ms 1740 KB Output is correct
14 Correct 695 ms 1740 KB Output is correct
15 Correct 740 ms 2004 KB Output is correct
16 Correct 815 ms 2004 KB Output is correct
17 Correct 876 ms 2004 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 3 ms 496 KB Output is correct
4 Correct 547 ms 756 KB Output is correct
5 Correct 603 ms 1004 KB Output is correct
6 Correct 664 ms 1004 KB Output is correct
7 Correct 548 ms 1004 KB Output is correct
8 Correct 538 ms 1004 KB Output is correct
9 Correct 578 ms 1004 KB Output is correct
10 Correct 83 ms 1740 KB Output is correct
11 Correct 70 ms 1740 KB Output is correct
12 Correct 17 ms 1740 KB Output is correct
13 Correct 588 ms 1740 KB Output is correct
14 Correct 695 ms 1740 KB Output is correct
15 Correct 740 ms 2004 KB Output is correct
16 Correct 815 ms 2004 KB Output is correct
17 Correct 876 ms 2004 KB Output is correct
18 Execution timed out 1545 ms 2456 KB Time limit exceeded
19 Halted 0 ms 0 KB -