QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#555897#7281. How to Avoid Disqualification in 75 Easy Stepsuser100860 1ms3736kbC++171.5kb2024-09-10 11:57:572024-09-10 11:58:00

Judging History

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

  • [2024-09-10 11:58:00]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:3736kb
  • [2024-09-10 11:57:57]
  • 提交

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(signed _, signed __)
{
	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

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Runtime Error

Test #1:

score: 0
Runtime Error

input:



output:


result:


Subtask #2:

score: 0
Runtime Error

Test #11:

score: 0
Runtime Error

input:

\x14

output:


result:


Subtask #3:

score: 0
Runtime Error

Test #66:

score: 0
Runtime Error

input:

\x1e

output:


result:


Subtask #4:

score: 0
Wrong Answer

Test #120:

score: 0
Wrong Answer
time: 1ms
memory: 3736kb

input:

K

output:


result:

wrong answer Not correct