답안 #351348

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
351348 2021-01-20T01:26:39 Z Bill_00 질문 (CEOI14_question_grader) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#define N 100001
#define MOD 998244353
#define ll long long
#define pb push_back
const int M=62;
using namespace std;
int a[1025][1025],o=0;
vector<int>v[13][2];
void build(int id,int l,int r,int height){
	// cout << l << ' ' << r << '\n';
	if(id!=1){
		if(id%2==0){
			for(int i=l;i<=r;i++){
				v[height][0].pb(i);
			}
		}
		else{
			for(int i=l;i<=r;i++){
				v[height][1].pb(i);
			}
		}
	}
	if(l==r) return;
	int m=(l+r)>>1;
	build(id*2,l,m,height+1);
	build(id*2+1,m+1,r,height+1);
}
int encode (int n, int x, int y) {
	if(o==0){
		build(1,1,1024,0);
		for(int i=1;i<=10;i++){
			for(int j:v[i][0]){
				for(int k:v[i][1]){
					a[j][k]=i;
				}
			}
		}
		for(int j:v[10][1]){
			for(int k:v[10][0]){
				a[j][k]=11;
			}
		}
		o++;
	}
	return a[x][y];
}
int decode (int n, int q, int h) {
	if(h!=11){
		int k=10-h;
		k=pow(2,k);
		int d=(q-1)/k;
		if(d%2==0){
			return 1;
		}
		else return 0;
	}
	else{
		if(q%2==0){
			return 1;
		}
		else return 0;
	}
}

Compilation message

decoder.cpp: In function 'int decode(int, int, int)':
decoder.cpp:4:5: error: 'pow' was not declared in this scope
    4 |   k=pow(2,k);
      |     ^~~