#include <bits/stdc++.h>
#include "Alice.h"
using namespace std;
vector<pair<int, int>> Alice() {
long long x = setN(5000);
vector<pair<int, int>> r;
x--;
if (x % 5000 == x / 5000) {
for (int i = 1; i <= 5000; ++i) {
if (i == x % 5000 + 1) continue;
r.emplace_back(x % 5000 + 1, i);
}
return r;
}
r.emplace_back(x % 5000 + 1, x / 5000 + 1);
for (int i = 1; i <= 5000; ++i) {
if (i == x % 5000 + 1 || i == x / 5000 + 1) continue;
if (r.size() < 2499) r.emplace_back(x % 5000 + 1, i);
else r.emplace_back(i, x / 5000 + 1);
}
return r;
}
#include <bits/stdc++.h>
#include "Bob.h"
using namespace std;
long long Bob(vector<pair<int, int>> V) {
map<int, int> mp;
for (auto &[x, y] : V) {
mp[x]++;
mp[y]++;
}
vector<int> a;
for (auto &[x, y] : mp) if (y > 1) a.emplace_back(x);
if (a.size() == 1) return a[0] * 5000 - 5000 + a[0];
for (auto [x, y] : V) {
if (x == a[0]) return a[1] * 5000 - 5000 + a[0];
if (x == a[1]) return a[0] * 5000 - 5000 + a[1];
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |