QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#885141#9237. MessageGeekmenCompile Error//C++14548b2025-02-06 14:11:422025-02-06 14:11:43

Judging History

This is the latest submission verdict.

  • [2025-02-06 14:11:43]
  • Judged
  • [2025-02-06 14:11:42]
  • Submitted

answer

#include <iostream>
#include <vector>
#include "message.h"
using namespace std;

void send_message(std::vector<bool> M, std::vector<bool> C) {
	int S = M.size();
	for (int i = 0; i < S; i ++)
		send_packet(std::vector<bool>(31, M[i]));
}
std::vector<bool> receive_message(std::vector<vector<bool>> R) {
	int S = R.size();
	std::vector<bool> res;
	for (int i = 0; i < S; i ++) {
		int C[2] = {0};
		for (int j = 0; j < 31; j ++)
			C[R[i][j]] ++;
		if (C[0] > C[1]) res.push_back(0);
		else res.push_back(1);
	}

	return res;
}

Details

stub.cpp: In function ‘int {anonymous}::sz(const C&)’:
stub.cpp:27:52: error: ‘size’ is not a member of ‘std’; did you mean ‘size_t’?
   27 | template<class C> int sz(const C& c) { return std::size(c); }
      |                                                    ^~~~
      |                                                    size_t
stub.cpp: In function ‘void {anonymous}::write_int_array(const int*, int)’:
stub.cpp:70:13: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’
   70 |         if (int ret = fwrite(arr, sizeof(int), len, fout); len != ret) {
      |             ^~~
stub.cpp: In function ‘void {anonymous}::read_int_array(int*, int)’:
stub.cpp:105:13: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’
  105 |         if (int ret = fread(arr, sizeof(int), len, fin); len != ret) {
      |             ^~~