Submission #988163

# Submission time Handle Problem Language Result Execution time Memory
988163 2024-05-24T07:40:51 Z vjudge1 Airline Route Map (JOI18_airline) C++17
Compilation error
0 ms 0 KB
#include "Boblib.h"
#include <bits/stdc++.h>
using namespace std;
#define CTD(D,I) for(auto i:adj[z]) {if(IN[i]&&i-w&&DEG[i]==D&&i!=v[I]){w=z,v.push_back(z=i);break;}}
vector<int>adj[1012];
int means[1024],val[1012],DEG[1012],IN[1012];
void Bob( int V, int U, int C[], int D[] ){
	int CC=0;
	for(int i=3;i<1024;i++)
		if(__builtin_popcount(i)>1)
			means[i]=CC++;
	for(int i=0;i<U;i++)
		adj[C[i]].push_back(D[i]),
		adj[D[i]].push_back(C[i]);
	int x,y,z,w=-1;
	for(int i=0;i<V;i++)
		if(adj[i].size()<2)
			x=i;
	y=adj[x][0];
	for(auto j:adj[y])
		IN[j]=1;
	for(int i=0;i<V;i++)
		for(auto j:adj[i])
			DEG[i]+=IN[j];
	for(auto i:adj[y])
		if(DEG[i]==1)
			z=i;
	vector<int>v{z};
	for(int Q=5;Q--;)for(auto i:adj[z])
		if(IN[i]&&i-w){w=z,v.push_back(z=i);break;}
	if(v.size()!=6) MakeMap(0,0);
	for(auto i:adj[z]) CTD(4,0)
	if(v.size()!=7) MakeMap(0,0);
	for(auto i:adj[z]){
		if(IN[i]&&i-w&&DEG[i]==3&&count(adj[i].begin(),adj[i].end(),v[5])){
			w=z,v.push_back(z=i);break;}}
	if(v.size()!=8) MakeMap(0,0);
	for(auto i:adj[z]) CTD(3,5)
	if(v.size()!=9) MakeMap(0,0);
	for(auto i:adj[z]) CTD(2,0)
	if(v.size()!=10) MakeMap(0,0);
	for(int i=0;i<10;i++)
		for(auto j:adj[v[i]])
			val[j]+=1<<i;
	vector<pair<int,int>>EEE;
	for(int i=0;i<U;i++) if(!IN[C[i]]&&!IN[D[i]]) {
		int A=means[val[C[i]]],B=means[val[D[i]]];
		EEE.push_back({A,B});
	}
	swap(EEE.back(),EEE[0]);
	InitMap(V-12,EEE.size());
	for(auto[i,j]:EEE)
		MakeMap(i,j);
}



    

Compilation message

Alice.cpp: In function 'void Bob(int, int, int*, int*)':
Alice.cpp:32:11: warning: unused variable 'i' [-Wunused-variable]
   32 |  for(auto i:adj[z]) CTD(4,0)
      |           ^
Alice.cpp:38:11: warning: unused variable 'i' [-Wunused-variable]
   38 |  for(auto i:adj[z]) CTD(3,5)
      |           ^
Alice.cpp:40:11: warning: unused variable 'i' [-Wunused-variable]
   40 |  for(auto i:adj[z]) CTD(2,0)
      |           ^
/usr/bin/ld: /tmp/cccW65FO.o: in function `Bob(int, int, int*, int*)':
Alice.cpp:(.text+0x42b): undefined reference to `MakeMap(int, int)'
/usr/bin/ld: Alice.cpp:(.text+0x649): undefined reference to `MakeMap(int, int)'
/usr/bin/ld: Alice.cpp:(.text+0x7d9): undefined reference to `InitMap(int, int)'
/usr/bin/ld: Alice.cpp:(.text+0x7f6): undefined reference to `MakeMap(int, int)'
/usr/bin/ld: Alice.cpp:(.text+0x88e): undefined reference to `MakeMap(int, int)'
/usr/bin/ld: Alice.cpp:(.text+0x8e1): undefined reference to `MakeMap(int, int)'
/usr/bin/ld: Alice.cpp:(.text+0x8fe): undefined reference to `MakeMap(int, int)'
/usr/bin/ld: /tmp/ccMIzKwO.o: in function `main':
grader_alice.cpp:(.text.startup+0xa2): undefined reference to `Alice(int, int, int*, int*)'
collect2: error: ld returned 1 exit status

/usr/bin/ld: /tmp/ccq6PyRw.o: in function `main':
grader_bob.cpp:(.text.startup+0xb2): undefined reference to `Bob(int, int, int*, int*)'
collect2: error: ld returned 1 exit status