# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
316553 | bigg | 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.
#include "Alicelib.h"
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 1010;
static vector<int> grafo[MAXN];
vector<pair<int, int> > vgrafo;
static int marc[1505][1505];
void Alice( int N, int M, int A[], int B[] ){
for(int i = 0; i < M; i++) {
grafo[A[i]].push_back(B[i]);
grafo[B[i]].push_back(A[i]);
vgrafo.push_back(make_pair(A[i], B[i]));
}
for(int i = 0; i < 10; i++){
for(int j = 0; j < N; j++){
if(j&(1<<i)){
vgrafo.push_back(make_pair(j, N + i));
}
}
vgrafo.push_back(make_pair(N + i, N + 10));
vgrafo.push_back(make_pair(N + i, N + 11));
if(i) vgrafo.push_back(make_pair(N+i, N + i -1));
}
vgrafo.push_back(make_pair(N + 1, N + 9));
vgrafo.push_back(make_pair(N + 3, N + 9));
for(int i = 0; i < N; i++){
vgrafo.push_back(make_pair(N + 11, i));
}
InitG(N + 12, vgrafo.size());
for(int i = 0; i < vgrafo.size(); i++){
MakeG(i, vgrafo[i].first, vgrafo[i].second);
}
}
#include "Alicelib.h"
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 1010;
static vector<int> grafo[MAXN];
vector<pair<int, int> > vgrafo;
static int marc[1505][1505];
void Alice( int N, int M, int A[], int B[] ){
for(int i = 0; i < M; i++) {
grafo[A[i]].push_back(B[i]);
grafo[B[i]].push_back(A[i]);
vgrafo.push_back(make_pair(A[i], B[i]));
}
for(int i = 0; i < 10; i++){
for(int j = 0; j < N; j++){
if(j&(1<<i)){
vgrafo.push_back(make_pair(j, N + i));
}
}
vgrafo.push_back(make_pair(N + i, N + 10));
vgrafo.push_back(make_pair(N + i, N + 11));
if(i) vgrafo.push_back(make_pair(N+i, N + i -1));
}
vgrafo.push_back(make_pair(N + 1, N + 9));
vgrafo.push_back(make_pair(N + 3, N + 9));
for(int i = 0; i < N; i++){
vgrafo.push_back(make_pair(N + 11, i));
}
InitG(N + 12, vgrafo.size());
for(int i = 0; i < vgrafo.size(); i++){
MakeG(i, vgrafo[i].first, vgrafo[i].second);
}
}