#include "Alice.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<pair<int, int>> Alice() {
const int kBits = 60;
const int kBuc = 83;
const int kN = kBits * kBuc + 2;
const int kSeed = 27;
ll x = setN(kN);
vector<pair<int, int>> edg;
array<int, kN + 1> ord;
iota(ord.begin() + 1, ord.end(), 1);
shuffle(ord.begin() + 1, ord.end(), default_random_engine(kSeed));
auto addEdge = [&](int u, int v) -> void {
edg.emplace_back(ord[u], ord[v]);
};
addEdge(1, 2);
int u = 3;
mt19937 rng(kSeed);
auto addBit = [&](int i) -> void {
bool b = x >> i & 1ll;
for(int _ = 0; _ < kBuc; _++) {
uint32_t rval = rng();
addEdge(u, (rval + b) % (u - 1) + 1);
u++;
}
};
for(int i = 0; i < kBits; i++) {
addBit(i);
}
shuffle(edg.begin(), edg.end(), default_random_engine(kSeed));
return edg;
}
#include "Bob.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll Bob(vector<pair<int, int>> edg){
const int kBits = 60;
const int kBuc = 83;
const int kN = kBits * kBuc + 2;
const int kSeed = 27;
sort(edg.begin(), edg.end());
array<int, kN + 1> ord;
iota(ord.begin() + 1, ord.end(), 1);
shuffle(ord.begin() + 1, ord.end(), default_random_engine(kSeed));
auto contains = [&](int u, int v) -> bool {
return binary_search(edg.begin(), edg.end(), make_pair(ord[u], ord[v]));
};
int u = 3;
ll x = 0;
mt19937 rng(kSeed);
auto findBit = [&]() -> ll {
ll res = 0;
for(int _ = 0; _ < kBuc; _++) {
uint32_t rval = rng();
for(bool b : {false, true}) {
if(contains(u, (rval + b) % (u - 1) + 1)) {
res = b;
}
}
u++;
}
return res;
};
for(int i = 0; i < kBits; i++) {
x |= findBit() << i;
}
return x;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
1068 KB |
Correct. |
2 |
Incorrect |
3 ms |
1060 KB |
Incorrect answer. |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
1068 KB |
Correct. |
2 |
Incorrect |
3 ms |
1060 KB |
Incorrect answer. |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
1068 KB |
Correct. |
2 |
Incorrect |
3 ms |
1060 KB |
Incorrect answer. |
3 |
Halted |
0 ms |
0 KB |
- |