QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#592959#8726. Magic Show-OfastCompile Error//C++201.6kb2024-09-27 10:34:432024-09-27 10:34:47

Judging History

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

  • [2024-09-27 10:34:47]
  • 评测
  • [2024-09-27 10:34:43]
  • 提交

Alice

#include <bits/stdc++.h>
#define mp make_pair
#define fir first
#define sec second
using namespace std;
	int fa[5005],vis[5005];
	vector <pair<int,int>> Alice(){
		mt19937 rnd(20080511);
		mt19937 rnd2(19911225);
		unsigned long long X=setN(4098);
		vector <int> id;
		for(int i=0;i<4096;i++)
			id.push_back(i+3);
		shuffle(id.begin(),id.end(),rnd);
		for(int i=0;i<4096;i++)vis[i+3]=rnd2()&1;
		vector <pair<int,int>> res;
		res.push_back(mp(2,1));fa[2]=1;
		int cnt=0;
		for(int i=0;i<4096;i+=64){
			for(int j=i;j<i+64;j++){
				fa[id[j]]=rnd()%(id[j]/2)+1;
				if(((X>>cnt)&1)^vis[id[j]]){
					fa[id[j]]+=(id[j]/2);
					if(fa[id[j]]==id[j])fa[id[j]]--;
				}
			}
			cnt++;
		}
		for(int i=3;i<=4098;i++)
			res.push_back(mp(i,fa[i]));
		return res;
	}

/*
int main(){
	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	Alice();
	return 0;
}
*/

Bob

#include <bits/stdc++.h>
#define mp make_pair
#define fir first
#define sec second
using namespace std;
	int fa[5005],inv[5005],vis[5005];
	long long Bob(vector <pair<int,int>> p){
		mt19937 rnd(20080511);
		mt19937 rnd2(19911225);
		vector <int> id;
		for(int i=0;i<4096;i++)
			id.push_back(i+3);
		shuffle(id.begin(),id.end(),rnd);
		for(int i=0;i<4096;i++)vis[i+3]=rnd2()&1;
		for(int i=0;i<4096;i++)
			inv[id[i]]=i/64;
		unsigned long long ans=0;
		for(auto it:p){
			if(it.fir==2)continue;
			if((it.sec>it.fir/2)^vis[it.fir])
				ans|=1ull<<(inv[it.fir]);
		}
		return ans;
	}
/*
int main(){
	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	Bob();
	return 0;
}
*/

詳細信息

Alice.code: In function ‘std::vector<std::pair<int, int> > Alice()’:
Alice.code:10:38: error: ‘setN’ was not declared in this scope
   10 |                 unsigned long long X=setN(4098);
      |                                      ^~~~