Submission #988148

# Submission time Handle Problem Language Result Execution time Memory
988148 2024-05-24T06:51:15 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;
	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;
			}
	for(auto i:adj[z]) CTD(4,0)
	for(auto i:adj[z]) 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;}
	for(auto i:adj[z]) CTD(3,5)
	for(auto i:adj[z]) CTD(2,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:35:11: warning: unused variable 'i' [-Wunused-variable]
   35 |  for(auto i:adj[z]) CTD(4,0)
      |           ^
Alice.cpp:36:11: warning: unused variable 'i' [-Wunused-variable]
   36 |  for(auto i:adj[z]) for(auto i:adj[z])
      |           ^
Alice.cpp:39:11: warning: unused variable 'i' [-Wunused-variable]
   39 |  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)
      |           ^
Alice.cpp:31:12: warning: 'w' may be used uninitialized in this function [-Wmaybe-uninitialized]
   31 |    if(IN[i]&&i-w){
      |       ~~~~~^~~~~
/usr/bin/ld: /tmp/ccO8DmME.o: in function `Bob(int, int, int*, int*)':
Alice.cpp:(.text+0x7de): undefined reference to `InitMap(int, int)'
/usr/bin/ld: Alice.cpp:(.text+0x7fe): undefined reference to `MakeMap(int, int)'
/usr/bin/ld: /tmp/ccO13LZB.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/ccqE1xdp.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