# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
920834 | vjudge1 | 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>
using namespace std;
#define pii pair<int,int>
#define fi first
#define se second
void Alice( int N, int M, int A[], int B[]){
int cur=1000;
vector<int> c(N,0);
for(int i=0;i<N;i++){
if(__builtin_popcount(i)<=8) c[i]=i;
else{
while(__builtin_popcount(cur)>8) cur++;
c[i]=cur++;
}
}
vector<pii> p;
for(int i=0;i<M;i++) p.push_back({A[i],B[i]});
for(int i=0;i<N;i++){
p.push_back({i,N+10});p.push_back({i,N+11});
for(int j=0;j<=9;j++) if(c[i]&(1<<j)) p.push_back({i,N+j});
}
for(int i=0;i<=9;i++) p.push_back({N+i,N+11});
for(int i=0;i<9;i++) p.push_back({N+i,N+i+1});
for(int i=2;i<=4;i++) p.push_back({N,N+i});
InitG(N+12,(int)p.size());
for(int i=0;i<(int)p.size();i++) MakeG(i,p[i].fi,p[i].se);
}