Submission #1177873

#TimeUsernameProblemLanguageResultExecution timeMemory
1177873adaawfMagic Show (APIO24_show)C++20
100 / 100
2 ms376 KiB
#include <bits/stdc++.h>
#include "Alice.h"
using namespace std;
mt19937 mt(chrono::steady_clock::now().time_since_epoch().count());
vector<pair<int, int>> Alice() {
    long long int x = setN(5000);
    int n = 5000;
    vector<pair<int, int>> v;
    v.push_back({1, 2});
    for (int i = 3; i <= n; i++) {
        int h = i % 60, k = mt() % (i - 1) + 1;
        if (x & (1ll << h)) h = 1;
        else h = 0;
        if (k % 2 != h) {
            if (k + 1 == i) k--;
            else k++;
        }
        v.push_back({k, i});
    }
    unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
    shuffle(v.begin(), v.end(), std::default_random_engine(seed));
    return v;
}
#include <bits/stdc++.h>
#include "Bob.h"
using namespace std;
long long int Bob(vector<pair<int, int>> v) {
    long long int res = 0;
    for (auto w : v) {
        if (w.first > w.second) swap(w.first, w.second);
        if (w.second == 2) continue;
        if (w.first & 1) {
            res |= (1ll << (w.second % 60));
        }
    }
    return res;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...