답안 #392333

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
392333 2021-04-20T19:57:48 Z ritul_kr_singh 컴퓨터 네트워크 (BOI14_network) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
// #define int long long
#define sp << ' ' <<
#define nl << '\n'
#include "network.h"

int ping(int a, int b){ return a; }
void travelTo(int a){}

void findRoute (int N, int a, int b){
	int dist = ping(a, b);
	vector<int> at[dist];
	for(int i=1; i<=N; ++i){
		if(i == a or i == b) continue;
		int k = ping(a, i);
		if(k < dist) at[k].push_back(i);
	}

	for(int i=0; i<dist; ++i){
		for(int j : at[i]){
			if(i + 1 + ping(j, b) == dist){
				travelTo(j);
				break;
			}
		}
	}
	travelTo(b);
}

signed main(){

}

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]
   48 |     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]
   51 |             scanf("%d", &distance[u][v]);
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/tmp/ccjETPdd.o: In function `ping(int, int)':
grader.c:(.text+0x30): multiple definition of `ping(int, int)'
/tmp/cc5lnXKR.o:network.cpp:(.text+0x0): first defined here
/tmp/ccjETPdd.o: In function `travelTo(int)':
grader.c:(.text+0xb0): multiple definition of `travelTo(int)'
/tmp/cc5lnXKR.o:network.cpp:(.text+0x10): first defined here
/tmp/ccjETPdd.o: In function `main':
grader.c:(.text.startup+0x0): multiple definition of `main'
/tmp/cc5lnXKR.o:network.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status