QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#555895#7281. How to Avoid Disqualification in 75 Easy Stepsuser10086Compile Error//C++171.5kb2024-09-10 11:57:322024-09-10 11:57:33

Judging History

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

  • [2024-09-10 11:57:33]
  • 评测
  • [2024-09-10 11:57:32]
  • 提交

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;
//		}
//	}
//}

void query(const vector<int>& v)
{
	vector<signed> q;
	for (int x : v) q.push_back(x);
	send(q);
}

int R[N] = {};

pair<signed, signed> 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);
		query(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

/usr/bin/ld: /tmp/ccIPMsD0.o: in function `main':
implementer.cpp:(.text.startup+0x1b): undefined reference to `scout(int, int)'
collect2: error: ld returned 1 exit status