Submission #72215

#TimeUsernameProblemLanguageResultExecution timeMemory
72215----------넘사벽---------- (#118)Judge Against Wrong Code (FXCUP3_judge)C++17
10 / 100
141 ms11184 KiB
#include<bits/stdc++.h>
#define N 500005

using namespace std;

int Count[2000000];
char dat[N][22];
char input[22];
bool output[N];

int main(){
	int x, d, c;
	int i, j;
	int tmp;
	scanf("%d", &x);
	scanf("%d", &d);
	for(i=0;i<d;i++){
		scanf("%s", dat[i]);
	}
	scanf("%d", &c);
	int sub;
	for(i=0;i<c;i++){
		scanf("%s", input);
		tmp=0;
		for(j=0;j<20;j++){
			tmp*=2;
			if(input[j]=='x') tmp++;
		}
		for(sub=tmp;sub;sub=(sub-1)&tmp){
			Count[sub]++;
		}
	}
	for(i=0;i<d;i++){
		tmp=0;
		for(j=0;j<20;j++){
			tmp*=2;
			if(dat[i][j]=='o') tmp++;
		}
		int cnt=0;
		for(sub=tmp;sub;sub=(sub-1)&tmp){
			if(__builtin_popcount(sub)%2) cnt+=Count[sub];
			else cnt-=Count[sub];
		}
		output[cnt]=1;
	}
	for(i=1;i<=c;i++){
		printf("%c", output[i] ? 'o':'x');
	}
	printf("\n");
	return 0;
}

Compilation message (stderr)

judge.cpp: In function 'int main()':
judge.cpp:15:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &x);
  ~~~~~^~~~~~~~~~
judge.cpp:16:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &d);
  ~~~~~^~~~~~~~~~
judge.cpp:18:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s", dat[i]);
   ~~~~~^~~~~~~~~~~~~~
judge.cpp:20:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &c);
  ~~~~~^~~~~~~~~~
judge.cpp:23:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s", input);
   ~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...