답안 #216928

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
216928 2020-03-28T13:20:11 Z bharat2002 컴퓨터 네트워크 (BOI14_network) C++14
컴파일 오류
0 ms 0 KB
/*input

*/
#include<bits/stdc++.h>
using namespace std;
const int N=1e3 + 100;
const int mod=1e9 + 7;
#define int long long
const int inf=1e18;
#define pii pair<int, int>
#define f first
#define s second 
#define mp make_pair
#define FOR(i, n) for(int i=1;i<=n;i++)
#define TRACE(x) cerr << #x << " = " << x << endl 
//Trace prints the name of the variable and the value.
int dista[N], distb[N];
bool sf(int a, int b)
{
	return dista[a]<dista[b];
}
void findRoute(int n, int a, int b)
{
	for(int i=1;i<=n;i++)
	{
		if(i==a) continue;
		dista[i]=ping(i, a) +1;
	}
	for(int i=1;i<=n;i++)
	{
		if(i==b) continue;
		distb[i]=ping(i, b) + 1;
	}
	vector<int> vals;
	for(int i=1;i<=n;i++)
	{
		if(dista[i] + distb[i]==dista[b])
		{
			vals.push_back(i);
		}
	}
	sort(vals.begin(), vals.end());
	for(auto i:vals)
	{
		travelTo(i);
	}
}

Compilation message

network.cpp: In function 'void findRoute(long long int, long long int, long long int)':
network.cpp:27:12: error: 'ping' was not declared in this scope
   dista[i]=ping(i, a) +1;
            ^~~~
network.cpp:27:12: note: suggested alternative: 'inf'
   dista[i]=ping(i, a) +1;
            ^~~~
            inf
network.cpp:32:12: error: 'ping' was not declared in this scope
   distb[i]=ping(i, b) + 1;
            ^~~~
network.cpp:32:12: note: suggested alternative: 'inf'
   distb[i]=ping(i, b) + 1;
            ^~~~
            inf
network.cpp:45:3: error: 'travelTo' was not declared in this scope
   travelTo(i);
   ^~~~~~~~
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]);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~