Submission #1138741

#TimeUsernameProblemLanguageResultExecution timeMemory
1138741adiyerMagic Show (APIO24_show)C++20
0 / 100
2 ms608 KiB
#include <bits/stdc++.h>
#include "Alice.h"

using namespace std;

typedef long long ll;

vector < pair < int, int > > Alice(){
    ll x = setN(5000), mid = 2500, k = mid;
    vector < pair < int, int > > g;
    for(int v = 2; v <= mid; v++) g.push_back({1, v});
    for(int v = 2; v <= 61; v++){
        if(!(x >> (v - 2) & 1)) continue;
        x -= (1ll << (v - 2));
        for(ll u = v; u <= mid; u += 60){
            if(k == 5000) break;
            g.push_back({u, ++k});
        }
        if(!x)
            while(k < 5000) 
                g.push_back({v, ++k});
    }
    while(k < 5000) g.push_back({1, ++k});
    return g;
}
#include <bits/stdc++.h>
#include "Bob.h"

using namespace std;

typedef long long ll;

long long Bob(vector < pair < int, int > > V){
	ll x = 0, mid = 2500;
    vector < int > g[5050];
    for(int i = 0; i < V.size(); i++){
        g[V[i].first].push_back(V[i].second);
        g[V[i].second].push_back(V[i].first);
    }
    for(int v = 2; v <= 61; v++){
        for(ll u = v; u <= mid; u += 60){
            if(g[u].size() <= 1) continue;
            x |= (1ll << (v - 2));
        }
    }
    return x;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...