# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
947325 | Cyber_Wolf | Airline Route Map (JOI18_airline) | C++17 | 0 ms | 0 KiB |
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 "Alicelib.h"
#include <bits/stdc++.h>
#include <cassert>
#include <cstdio>
using namespace std;
void Alice( int N, int M, int A[], int B[] ){
vector<array<int, 2>> v;
for(int i = 0; i < M; i++)
{
v.push_back({A[i], B[i]});
}
for(int i = N; i < 2*N+1; i++)
{
for(int j = i+1; j < 2*N+1; j++)
{
v.push_back({i, j});
}
}
for(int i = 0; i < N; i++)
{
for(int j = N; j < N+i; j++)
{
v.push_back({i, j});
}
}
InitG(2*N+1, v.size());
for(int i = 0; i < v.size(); i++)
{
MakeG(i, v[i][0], v[i][1]);
}
}
#include "Boblib.h"
#include <bits/stdc++.h>
#include <cassert>
#include <cstdio>
void Bob( int V, int U, int C[], int D[] ){
int N = (V-1)/2;
int deg[V], p[V];
memset(deg, 0, sizeof(deg));
memset(p, 0, sizeof(p));
for(int i = 0; i < U; i++)
{
deg[C[i]]++;
deg[D[i]]++;
}
vector<int> o;
for(int i = 0; i < V; i++)
{
if(deg[i] >= N)
{
o.push_back(i);
}
}
vector<array<int, 2>> v;
for(int i = 0; i < U; i++)
{
if(deg[C[i]] >= N || deg[D[i]] >= N)
{
p[D[i]]++, p[C[i]]++;
continue;
}
v.push_back({C[i], D[i]});
}
InitMap(N, v.size());
for(auto [a, b] : v) MakeMap(p[a], p[b]);
}