# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
595139 | Koosha_mv | 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 <cassert>
#include <cstdio>
#include <bits/stdc++.h>
using namespace std;
#define dbgv(v) cout<<#v<<" = "; f(i,0,v.size()) cout<<v[i]<<" "; cout<<endl
#define dbga(a,x,y) cout<<#a<<" = "; f(i,x,y) cout<<a[i]<<" "; cout<<endl
#define erorp(x) cout<<#x<<"={"<<x.F<<" , "<<x.S<<"}"<<endl
#define eror(x) cout<<#x<<'='<<(x)<<endl
#define f_(i,a,b) for(int i=a;i>=b;i--)
#define f(i,a,b) for(int i=a;i<b;i++)
#define nb(x) __builtin_popcount(x)
#define all(v) v.begin(),v.end()
#define bit(n,k) (((n)>>(k))&1)
#define Add(x,y) x=(x+y)%mod
#define maxm(a,b) a=max(a,b)
#define minm(a,b) a=min(a,b)
#define lst(x) x[x.size()-1]
#define sz(x) int(x.size())
#define mp make_pair
#define ll long long
#define pb push_back
#define S second
#define F first
const int N=1e6+99,lg=10;
int n,m,cnt;
vector<pair<int,int>> edge;
void Alice(int _n,int _m,int A[],int B[] ){
n=_n,m=_m;
f(i,0,n){
f(j,0,lg){
if(bit(i+1,j)){
edge.pb({i,n+j});
}
}
}
f(j,0,lg-1) edge.pb({n+j,n+j+1});
f(i,0,n+lg) edge.pb({i,n+lg});
f(i,n,n+lg) edge.pb({i,n+lg+1});
InitG(n+lg+2,m+edge.size());
f(i,0,m) MakeG(cnt++,A[i],B[i]);
for(auto p : edge) MakeG(cnt++,p.F,p.S);
}
/*void Alice( int N, int M, int A[], int B[] ){
InitG(3,2);
MakeG(0,0,1);
MakeG(1,1,2);
}*/