답안 #316553

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
316553 2020-10-26T16:15:10 Z bigg 항공 노선도 (JOI18_airline) C++14
컴파일 오류
0 ms 0 KB
#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);
	}


}

Compilation message

Alice.cpp: In function 'void Alice(int, int, int*, int*)':
Alice.cpp:30:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |  for(int i = 0; i < vgrafo.size(); i++){
      |                 ~~^~~~~~~~~~~~~~~
Alice.cpp: At global scope:
Alice.cpp:7:12: warning: 'marc' defined but not used [-Wunused-variable]
    7 | static int marc[1505][1505];
      |            ^~~~

Bob.cpp: In function 'void Alice(int, int, int*, int*)':
Bob.cpp:30:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |  for(int i = 0; i < vgrafo.size(); i++){
      |                 ~~^~~~~~~~~~~~~~~
Bob.cpp: At global scope:
Bob.cpp:7:12: warning: 'marc' defined but not used [-Wunused-variable]
    7 | static int marc[1505][1505];
      |            ^~~~
/tmp/ccyKNFcq.o: In function `main':
grader_bob.cpp:(.text.startup+0xcb): undefined reference to `Bob(int, int, int*, int*)'
/tmp/cc9vBWIY.o: In function `Alice(int, int, int*, int*)':
Bob.cpp:(.text+0x25b): undefined reference to `InitG(int, int)'
Bob.cpp:(.text+0x280): undefined reference to `MakeG(int, int, int)'
collect2: error: ld returned 1 exit status