QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#673937#8726. Magic ShowPhysics212303Compile Error//C++171.6kb2024-10-25 11:58:402024-10-25 11:58:41

Judging History

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

  • [2024-10-25 11:58:41]
  • 评测
  • [2024-10-25 11:58:40]
  • 提交

Alice

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int N=5000;
mt19937 g(time(0)),g2(1e9+9);
uniform_int_distribution<> u(100,200);
inline vector<int> gen(){
  vector<int> p(N);
  iota(p.begin(),p.end(),0);
  shuffle(p.begin(),p.end(),g2);
  return p;
}
vector<pii> Alice(){
  ll X=setN(N);
  vector<pii> e;
  int B=u(g);
  for(int i=3001;i<=N;i++)
    e.emplace_back(i,B+i/62);
  vector<int> v;
  while(X)v.emplace_back(X%B),X/=B;
  for(int i=1501;i<=3000;i++)
    e.emplace_back(i,v.size()+i/63);
  for(int i=501,c=0;i<=1500;i++,c%=v.size())
    e.emplace_back(i,v[c++]+i/64);
  for(int i=2;i<=500;i++)
    e.emplace_back(i,g()%(i-1)+1);
  auto p=gen();
  for(auto &[x,y]:e)
    assert(x<=y),x=p[x-1]+1,y=p[y-1]+1;
  shuffle(e.begin(),e.end(),g);
  return e;
}

Bob

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int N=5000;
mt19937 g2(1e9+9);
inline vector<int> gen(){
  vector<int> p(N),a(N);
  iota(p.begin(),p.end(),0);
  shuffle(p.begin(),p.end(),g2);
  for(int i=0;i<N;i++)
    a[p[i]]=i;
  return a;
}
ll Bob(vector<pii> e){
  int B=-1,E=-1;
  vector<int> X(N,-1);
  auto p=gen();
  for(auto &[x,y]:e){
    x=p[x-1]+1,y=p[y-1]+1;
    if(x>y)swap(x,y);
    if(y>3000)B=x-y/62;
    else if(y>1500)E=x-y/63;
    else if(y>500)X[y-501]=x-y/64;
  }
  assert(~B&&~E);
  vector<int> v(E);
  for(int i=501;i<=1500;i++)
    if(~X[i-501])v[(i-501)%E]=X[i-501];
  ll c=0,s=1;
  for(int i=0;i<E;i++,s*=B)
    c+=s*v[i];
  return c;
}

Details

Alice.code: In function ‘std::vector<std::pair<int, int> > Alice()’:
Alice.code:15:8: error: ‘setN’ was not declared in this scope
   15 |   ll X=setN(N);
      |        ^~~~