QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#601243 | #8726. Magic Show | xwh_Marvelous | Compile Error | / | / | C++14 | 1.3kb | 2024-09-29 21:49:03 | 2024-09-29 21:49:03 |
Judging History
Alice
#include<bits/stdc++.h>
#include"Alice.h"
using namespace std;
//#define int long long
//#define mod 1000000007
#define N 5005
//#define pii pair<int,int>
//#define fi first
//#define se second
//#define rep(i,j,k) for(int i=j;i<=k;i++)
vector<std::pair<int, int>>op;
int a[N],b[N];
vector<int>ls[2];
mt19937 rd(114514);
void gen(){
for(int i=3;i<=5000;i++)a[i]=rd()%64;
b[1]=0,b[2]=1;
for(int i=3;i<=5000;i++)b[i]=rd()%2;
}
std::vector<std::pair<int, int>> Alice(){
long long x=setN(5000);
gen();
op.push_back({1,2});
ls[0].push_back(1),ls[1].push_back(2);
for(int i=3;i<=n;i++){
op.push_back({ls[(x>>a[i])&1][rd()%ls[(x>>a[i])&1].size()],i});
ls[b[i]].push_back(i);
}
return op;
}
Bob
#include<bits/stdc++.h>
#include"Bob.h"
using namespace std;
// #define int long long
//#define mod 1000000007
#define N 5005
//#define pii pair<int,int>
//#define fi first
//#define se second
//#define rep(i,j,k) for(int i=j;i<=k;i++)
vector<std::pair<int, int>>op;
int a[N],b[N];
mt19937 rd(114514);
void gen(){
for(int i=3;i<=5000;i++)a[i]=rd()%64;
b[1]=0,b[2]=1;
for(int i=3;i<=5000;i++)b[i]=rd()%2;
}
long long Bob(std::vector<std::pair<int, int>> V){
gen();
long long ans=0;
for(auto op:V){
int u=op.fi,v=op.se;
if(u>v)swap(u,v);
ans|=(b[u]<<a[v]);
}
return ans;
}
详细
Alice.code: In function ‘std::vector<std::pair<int, int> > Alice()’: Alice.code:25:24: error: ‘n’ was not declared in this scope 25 | for(int i=3;i<=n;i++){ | ^