Submission #1203533

#TimeUsernameProblemLanguageResultExecution timeMemory
1203533m5588ohammedMagic Show (APIO24_show)C++20
0 / 100
2 ms612 KiB
#include <bits/stdc++.h> #include "Alice.h" using namespace std; // you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables. // you had better not use the same global variables in function Alice() and in function Bob(). vector <long long> seedA; int NA=5000-2; void constructA(){ seedA.push_back(0); seedA.push_back(0); seedA.push_back(0); for(int i=3;i<=5000;i++){ seedA.push_back(i/83); } shuffle(seedA.begin()+3,seedA.end(),mt19937(246)); return; } vector<pair<int,int>> Alice(){ constructA(); long long x=setN(5000),n=5000; vector <pair<int,int>> edges; edges.push_back({1,2}); for(int i=3;i<=n;i++){ if(((1LL<<seedA[i])&x)==0){ edges.push_back({1,i}); } else{ edges.push_back({2,i}); //cout<<2<<' '<<i<<' '<<seedA[i]<<'\n'; } } return edges; }
#include <bits/stdc++.h> #include "Bob.h" using namespace std; // you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables. // you had better not use the same global variables in function Alice() and in function Bob(). vector <long long> seedB; int NB=5000-2; void constructB(){ seedB.push_back(0); seedB.push_back(0); seedB.push_back(0); for(int i=3;i<=5000;i++){ seedB.push_back(i/83); } shuffle(seedB.begin()+3,seedB.end(),mt19937(246)); return; } long long bt[61],key[5001]; long long Bob(std::vector<std::pair<int,int>> V){ constructB(); for(auto [a,b]:V){ if(a==2) bt[seedB[b]]=1; } long long x; for(int i=0;i<=60;i++) x+=(1ll<<i)*bt[i]; return x; // change this into your code }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...