# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1196982 | b00legen | Magic Show (APIO24_show) | C++17 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<pair<int, int> > Alice(){
ll x = setN(5000);
vector<pair<int, int> >res;
for (int i = 1; i <= 5000; i++) {
if (x == i)
continue;
else
res.push_back({i, x});
}
return res;
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll Bob(vector<pair<int, int> >V) {
int cnt[5001];
for (int i = 0; i <= 5000; i++)
cnt[i] = 0;
for (size_t i = 0; i < V.size(); i++) {
cnt[V[i].first]++;
cnt[V[i].second]++;
}
ll res = 0;
for (int i = 1; i <= 5000; i++)
if (cnt[res] < cnt[i])
res = i;
return res;
}