Submission #1203565

#TimeUsernameProblemLanguageResultExecution timeMemory
1203565emad234Magic Show (APIO24_show)C++20
100 / 100
4 ms624 KiB
#include "Alice.h"
#include "bits/stdc++.h"
using namespace std;
vector<pair<int,int>> Alice(){
    long long x = setN(5000);
		vector<int>idx;
		for(int i = 1;i <= 5000;i++) idx.push_back(i / 83);
		shuffle(idx.begin(),idx.end(),mt19937(234));
		vector<pair<int, int>>v = {{1,2},{1,3}};
		for(int i = 4;i <= 5000;i++)
			if((x & (1LL << (idx[i - 1])))) v.push_back({2,i});
			else v.push_back({3,i});
		return v;
}
#include "Bob.h"
#include "bits/stdc++.h"
using namespace std;
long long Bob(vector<pair<int,int>> V){
	int vis[70] = {};
	vector<long long>idx,v[4];
	for(int i = 1;i <= 5000;i++)idx.push_back(i / 83);
	shuffle(idx.begin(),idx.end(),mt19937(234));
	for(auto x : V) if(x.first == 3 || x.first == 2) v[x.first].push_back(x.second);
	long long st = (v[2].size() > v[3].size() ? 2 : 3);
	long long ans = (st == 3 ? ans = (1LL << 61) - 1 : 0);
	for(auto x : v[st]) if(!vis[idx[x - 1]]++) ans += (1LL << idx[x - 1]) * (st == 2 ? 1 : -1);
	return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...