Submission #1203542

#TimeUsernameProblemLanguageResultExecution timeMemory
1203542m5588ohammedMagic Show (APIO24_show)C++20
0 / 100
2 ms608 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(){
    for(int i=0;i<=5000;i++){
        seedA.push_back(i/83);
    }
    shuffle(seedA.begin(),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});
        }
    }
    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(){
    for(int i=0;i<=5000;i++){
        seedB.push_back(i/83);
    }
    shuffle(seedB.begin(),seedB.end(),mt19937(246));
    return;
}
long long bt[65];
vector <int> v[3];
long long Bob(std::vector<std::pair<int,int>> V){
    constructB();
	for(auto [a,b]:V){
        if(a==1){
            if(b!=2) v[a].push_back(b);
        }
        else v[b].push_back(a);
    }
    if(v[1].size()>v[2].size()){
        for(int i=0;i<=60;i++) bt[i]=1;
        for(int j:v[1]) bt[seedB[j]]=0;
    }
    else for(int j:v[2]) bt[seedB[j]]=1;    
    long long x=0;
    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...