답안 #73090

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
73090 2018-08-27T15:48:38 Z Pajaraja 비교 (balkan11_cmp) C++17
컴파일 오류
0 ms 0 KB
#include "cmp.h"
#include <bits/stdc++.h>
using namespace std;
void remember(int n) 
{
	int poc[6]={1,4500,6000,6500,7000,7500},c[6],p[7];
	p[6]=0;
	for(int i=0;i<6;i++) c[i]=2*((1<<(11-2*i)) & n) + ((1<<(10-2*i)) & n);
	for(int i=5;i>=0;i--) p[i]=4*p[i+1]+c[i];
	for(int i=0;i<6;i++) bit_set(poc[i]+p[i]);
}
int compare(int b)
{
	int poc[6]={1,4500,6000,6500,7000,7500},c[6],p[7];
	p[6]=0;
	for(int i=0;i<6;i++) c[i]=2*((1<<(11-2*i)) & b) + ((1<<(10-2*i)) & b);
	for(int i=5;i>=0;i--) p[i]=4*p[i+1]+c[i];
	int x=0;
	while(get_bit(poc[x]+p[x]) && x<6) x++;
	if(x==6) return 0;
	if(c[x]==0) return -1;
	if(c[x]==3) return 1;
	if(c[x]==1)
	{
		if(poc[x]+p[x]-(1<<(10-2*x))) return 1;
		else return -1;
	}
	if(poc[x]+p[x]+(1<<(10-2*x))) return 1;
	else return -1;
}

Compilation message

cmp.cpp: In function 'int compare(int)':
cmp.cpp:19:8: error: 'get_bit' was not declared in this scope
  while(get_bit(poc[x]+p[x]) && x<6) x++;
        ^~~~~~~
cmp.cpp:19:8: note: suggested alternative: 'gettext'
  while(get_bit(poc[x]+p[x]) && x<6) x++;
        ^~~~~~~
        gettext