답안 #107932

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
107932 2019-04-26T09:28:22 Z tjd229 컴퓨터 네트워크 (BOI14_network) C++14
50 / 100
129 ms 8056 KB
#include "network.h"
#include <vector>
using namespace std;
vector<int> candi[1000];
void findRoute (int N, int a, int b)
{
	int len = ping(a, b);
	for (int i = 1; i <= N; ++i) {
		if (a == i || b == i) continue;
		int d = ping(a, i);
		candi[d].push_back(i);
	}
	for (int i = 0; i < len; ++i) {
		for (auto x : candi[i]) {
			if (i != 0) {
				if (ping(a, x)) continue;
			}			
			if (ping(x, b) + i + 1 == len) {
				a = x;
				travelTo(a);
				break;
			}			
		}
	}
	travelTo(b);	
}

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]);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 99 ms 8056 KB Too many calls to ping
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 87 ms 6740 KB Output is correct
2 Correct 25 ms 2940 KB Output is correct
3 Correct 121 ms 7932 KB Output is correct
4 Correct 115 ms 6264 KB Output is correct
5 Correct 129 ms 8056 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 111 ms 6792 KB Output is correct
2 Correct 26 ms 2908 KB Output is correct
3 Correct 124 ms 8008 KB Output is correct
4 Correct 100 ms 6236 KB Output is correct
5 Correct 129 ms 8028 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 127 ms 6748 KB Output is correct
2 Correct 26 ms 3040 KB Output is correct
3 Incorrect 119 ms 7900 KB Too many calls to ping
4 Halted 0 ms 0 KB -