QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#559672#8221. 多方计算The_cosmosCompile Error//C++17492b2024-09-12 08:16:172024-09-12 08:16:17

Judging History

你现在查看的是最新测评结果

  • [2024-09-12 08:16:17]
  • 评测
  • [2024-09-12 08:16:17]
  • 提交

answer

#include "mpc.h"
int qn, qm;
int precalc(int n, int m) {
	qn = n, qm = m;
	return n + m + 3;
}
bool transmit(player& player, int round, int position) {
	int p = round - position - 1;
	if(p < 0) {
		if(p > -9) p += qm + 4;
		else p += qm + 19;
	}
	if(p < 0) return false;
	if(player.last_message) {
		int q = p;
		while(player.memory[q]) player.memory[q ++] = 0;
		player.memory[q] = 1;
	}
	bool r = player.memory[p];
	if(position != n) player.memory[p] = 0;
	return r;
} 

详细

answer.code: In function ‘bool transmit(player&, int, int)’:
answer.code:20:24: error: ‘n’ was not declared in this scope
   20 |         if(position != n) player.memory[p] = 0;
      |                        ^