QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#555892#7281. How to Avoid Disqualification in 75 Easy Stepsuser10086Compile Error//C++171.4kb2024-09-10 11:55:552024-09-10 11:55:55

Judging History

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

  • [2024-09-10 11:55:55]
  • 评测
  • [2024-09-10 11:55:55]
  • 提交

answer

#include <bits/stdc++.h>
#include "avoid.h"

using namespace std;

const int N = 1000, MAX = 52;

#define int unsigned long long

//int R[N];
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//
//bool check()
//{
//	unordered_set<int> all;
//	for (int i = 0; i < N; i++)
//		for (int j = i; j < N; j++)
//		{
//			int val = R[i] | R[j];
//			if (all.find(val) != all.end()) return false;
//			all.insert(val);
//		}
//	return true;
//}
//
//int rnd()
//{
//	return rng() % 100 <= 30;
//}

//signed main()
//{
//	int rd = 0;
//	while (1)
//	{
//		rd++;
//		cerr << rd << endl;
//		for (int i = 0; i < N; i++) R[i] = 0;
//		for (int i = 0; i < N; i++)
//			for (int j = 0; j < MAX; j++)
//				R[i] |= (rnd() << j);
//		if (check())
//		{
//			for (int i = 0; i < N; i++) cout << R[i] << ',';
//			cout << endl << rd << ' ' << clock() << endl; 
//			return 0;
//		}
//	}
//}

int R[N] = {};

pair<int, int> scout(int _, int __)
{
	assert(_ == 75 && __ == 1);

	
	for (int i = 0; i < MAX; i++)
	{
		vector<int> ask;
		for (int j = 0; j < N; j++)
			if (R[j] >> i & 1) ask.push_back(j + 1);
		send(ask);
	}
	auto res = wait();
	int x = 0;
	for (int i = 0; i < MAX; i++) x |= (res[i] << i);
	for (int i = 0; i < N; i++)
		for (int j = i; j < N; j++)
			if (x == (R[i] | R[j])) return {i, j};
	assert(0);
}

Details

answer.code: In function ‘std::pair<long long unsigned int, long long unsigned int> scout(long long unsigned int, long long unsigned int)’:
answer.code:63:22: error: could not convert ‘ask’ from ‘vector<long long unsigned int>’ to ‘vector<int>’
   63 |                 send(ask);
      |                      ^~~
      |                      |
      |                      vector<long long unsigned int>