제출 #47315

#제출 시각아이디문제언어결과실행 시간메모리
47315ista2000Computer Network (BOI14_network)C++17
100 / 100
148 ms47668 KiB
#include <bits/stdc++.h>
#include "network.h"
using namespace std;

void findRoute (int n, int a, int b)
{
    /*
     *  Obviously, this is not a good solution.
     *  Replace it with your own code.
     */

    vector<int> v(n);
	for(int i = 0;i<n;i++)
		if(i!=b-1)
			v[i] = ping(i+1, b)+1;
	int cur = a-1;
	while(cur!=b-1)
	{
		for(int i = 0;i<n;i++)
		{
			if(v[i]==v[cur]-1)
			{
				int x = ping(cur+1, i+1);
				if(!x)
				{
					travelTo(i+1);
					cur = i;
					break;
				}
			}
		}
	}
}

컴파일 시 표준 에러 (stderr) 메시지

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]);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...