Submission #1203572

#TimeUsernameProblemLanguageResultExecution timeMemory
1203572emad234Magic Show (APIO24_show)C++20
100 / 100
2 ms628 KiB
#include "Alice.h"
#include "bits/stdc++.h"
using namespace std;
vector<pair<int,int>> Alice(){
		pair<vector<pair<int,int>>,vector<long long>>idx, x = {{{0,0}},{setN(5000)}},v = {{{1,2},{1,3}}, {0}};;
		for(int i = 1;i <= 5000;i++) idx.second.push_back(i / 83);
		shuffle(idx.second.begin(),idx.second.end(),mt19937(234));
		for(int i = 4;i <= 5000;i++) v.first.push_back((x.second[0] & (1LL << (idx.second[i - 1]))) ? make_pair(2,i) : make_pair(3,i));
		return v.first;
}
#include "Bob.h"
#include "bits/stdc++.h"
using namespace std;
long long Bob(vector<pair<int,int>> V){
	vector<long long>idx,v[4],vis(70);
	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), 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...