답안 #105970

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
105970 2019-04-16T03:10:45 Z xiaowuc1 컴퓨터 네트워크 (BOI14_network) C++14
컴파일 오류
0 ms 0 KB
#include <algorithm>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <vector>

#include "network.h"

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, pii> pipii;
typedef vector<vector<ll>> matrix;

void findRoute(int N, int a, int b) {
	map<int, int> distToB;
	for(int i = 1; i <= N; i++) {
		if(i == b) distToB[i] = 0;
		else distToB[i] = ping(i, b) + 1;
	}
	int curr = a;
	while(curr != b) {
		if(distToB[curr] == 1) {
			travelTo(b);
			break;
		}
		bool found = false;
		for(auto out: distToB) {
			if(distToB[curr] == 1 + out.second) {
				if(ping(curr, out.first) == 0) {
					travelTo(out.first);
					found = true;
					break;
				}
			}
		}
		assert(found);
	}
}

void solve() {
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
	/*
  int t;
  cin >> t;
  for(int i = 1; i <= t; i++) {
    cout << "Case #" << i << ": ";
    solve();
  }
	*/
	solve();
}

Compilation message

grader.c: In function 'int main()':
grader.c:48:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf ("%d%d%d%d", &N, &a, &b, &M);
     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
grader.c:51:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d", &distance[u][v]);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/tmp/cc6MTwS4.o: In function `main':
grader.c:(.text.startup+0x0): multiple definition of `main'
/tmp/ccRLqf4M.o:network.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status