This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include "Alicelib.h"
using namespace std;
const int MAXN = 1510;
int in[MAXN];
void Alice(int n, int m, int a[], int b[])
{
int nodes = n;
vector<pair<int, int> > ans;
for(int i = 0; i < m; i++)
in[a[i]]++, in[b[i]]++;
for(int i = 0; i < n; i++)
for(int j = in[i]; j < i + 40; j++)
ans.push_back(make_pair(i, nodes++));
InitG(nodes, (int) ans.size() + m);
for(int i = 0; i < m; i++) MakeG(i, a[i], b[i]);
for(int i = m; i < m + (int) ans.size(); i++) MakeG(i, ans[i - m].first, ans[i - m].second);
}
#include<bits/stdc++.h>
#include "Boblib.h"
using namespace std;
const int MAXN = 1510;
int in[MAXN], p[MAXN];
void Bob(int v, int u, int c[], int d[])
{
for(int i = 0; i < u; i++)
in[c[i]]++, in[d[i]]++;
for(int i = 0; i < v; i++)
{
if(in[i] < 40) p[i] = MAXN * MAXN;
else p[i] = in[i] - 40;
}
vector<pair<int, int> > ans;
int n = 0;
for(int i = 0; i < u; i++)
{
int a = p[c[i]];
int b = p[d[i]];
if(a < MAXN * MAXN) n = max(n, a);
if(b < MAXN * MAXN) n = max(n, b);
if(a == MAXN * MAXN || b == MAXN * MAXN) continue;
ans.push_back(make_pair(a, b));
}
InitMap(n + 1, (int) ans.size());
for(int i = 0; i < (int) ans.size(); i++) MakeMap(ans[i].first, ans[i].second);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |