답안 #343607

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
343607 2021-01-04T09:23:11 Z Kerim 질문 (CEOI14_question_grader) C++17
0 / 100
316 ms 47980 KB
int arr[924],pos;//C(12,6)
int encode (int n, int x, int y) {
	for(int i=0,x,y;i<4096;i++){x=i;y=0;
		while(x>=1)
			y+=(x%2),x/=2;	
		if(y==6)arr[pos++]=i;
	}
	for(int i=0;i<12;i++)
		if((arr[x-1]>>i&1) and !(arr[y-1]>>i&1))
			return i+1;
}
int arr[924],pos;
int decode (int n, int q, int h){
	for(int i=0,x,y;i<4096;i++){x=i;y=0;
		while(x>=1)
			y+=(x%2),x/=2;	
		if(y==6)arr[pos++]=i;
	}
	return (arr[q-1]>>(h-1)&1);
}

Compilation message

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:11:1: warning: control reaches end of non-void function [-Wreturn-type]
   11 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Runtime error 306 ms 47980 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Runtime error 316 ms 47980 KB Execution killed with signal 11 (could be triggered by violating memory limits)