# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
205665 | stefdasca | Airline Route Map (JOI18_airline) | C++14 | 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.
/*
JOISC 18-Airline
idea: https://ivaniscoding.wordpress.com/2018/08/27/communication-4-airline-route-map/
*/
#include "Alicelib.h"
#include<bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
using namespace std;
void Alice(int N, int M, int A[], int B[])
{
vector<pair<int, int> >muchii;
for(int i = 0; i < M; ++i)
muchii.pb({A[i], B[i]});
for(int i = 0; i <= 9; ++i)
{
for(int j = 0; j < N; ++j)
if(j & (1<<i))
muchii.pb({N + i, j});
if(i < 9)
muchii.pb({N + i, N + i + 1});
}
for(int j = 0; j < N; ++j)
muchii.pb({N + 10, j});
muchii.pb({N + 11, N + 10});
InitG(N + 12, muchii.size());
for (int i = 0; i < muchii.size(); i++)
MakeG(i, muchii[i].fi, muchii[i].se);
}
/*
JOISC 18-Airline
idea: https://ivaniscoding.wordpress.com/2018/08/27/communication-4-airline-route-map/
*/
#include "Alicelib.h"
#include<bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
using namespace std;
void Alice(int N, int M, int A[], int B[])
{
vector<pair<int, int> >muchii;
for(int i = 0; i < M; ++i)
muchii.pb({A[i], B[i]});
for(int i = 0; i <= 9; ++i)
{
for(int j = 0; j < N; ++j)
if(j & (1<<i))
muchii.pb({N + i, j});
if(i < 9)
muchii.pb({N + i, N + i + 1});
}
for(int j = 0; j < N; ++j)
muchii.pb({N + 10, j});
muchii.pb({N + 11, N + 10});
InitG(N + 12, muchii.size());
for (int i = 0; i < muchii.size(); i++)
MakeG(i, muchii[i].fi, muchii[i].se);
}