제출 #199140

#제출 시각아이디문제언어결과실행 시간메모리
199140godwindParrots (IOI11_parrots)C++14
컴파일 에러
0 ms0 KiB
int base[10];
void pre() {
	base[0] = 1;
	for (int i = 1; i < 9; ++i) {
		base[i] = base[i - 1] * 10;
	}
}
int len(int x) {
	if (x == 0) return 1;
	int l = 0;
	while (x) {
		x /= 10;
		++l;
	}
	return l;
}

void encode(int n, int M[]) {
	pre();
	for (int i = 0; i < n; ++i) {
		int x = i * base[3] + M[i];
		send(x);
	}
}
int ans[1000];

// void output(int x) {
// 	cout << x << endl;
// }

void decode(int n, int L, int X[]) {
	for (int i = 0; i < L; ++i) {
		int x = X[i] % 1000;
		X[i] /= 1000;

		int id = X[i];
		ans[id] = x;
	}
	for (int i = 0; i < n; ++i) {
		output(ans[i]);
	}
}

컴파일 시 표준 에러 (stderr) 메시지

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:22:3: error: 'send' was not declared in this scope
   send(x);
   ^~~~
encoder.cpp:22:3: note: suggested alternative: 'len'
   send(x);
   ^~~~
   len

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:16:3: error: 'output' was not declared in this scope
   output(ans[i]);
   ^~~~~~