QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#559675#8221. 多方计算zlttclCompile Error//C++14757b2024-09-12 08:18:192024-09-12 08:18:19

Judging History

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

  • [2024-09-12 08:18:19]
  • 评测
  • [2024-09-12 08:18:19]
  • 提交

answer

#include <bits/stdc++.h>
//#include <array>
//struct player{
//    bool last_message;
//    std::array<int, 4096> memory;
//};
//int precalc(int n, int m);
//bool transmit(player &player, int round, int position);
#include "mpc.h"
using namespace std;
int M, N;
int preclac(int n, int m){
	M = m, N = n;
	return n + m + 3;
}
bool transmit(player &player, int round, int position){
	int p = (round >= position + 1 ? round - position - 1 : M + 4 - (position - round) % 16);
	if(p < 0) return 0;
	player.memory[p] += player.last_message;
	for(int i = p; player.memory[i] >= 2; ++ i) player.memory[i] -= 2, ++ player.memory[i + 1];
	int res = player.memory[p];
	if(round <= position && position ^ N) player.memory[p] = 0;
	return res;
}

详细

/usr/bin/ld: /tmp/ccE3t3FE.o: in function `grader_random_string_fajsdkfsiauhfakjvh78467sd::grade()':
implementer.cpp:(.text+0x461): undefined reference to `precalc(int, int)'
collect2: error: ld returned 1 exit status