답안 #18412

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
18412 2016-02-01T03:55:58 Z tlwpdus 컴퓨터 네트워크 (BOI14_network) C++
100 / 100
146 ms 5220 KB
#include "network.h"
#include <vector>

using namespace std;

vector<int> lis[1100];

void findRoute (int N, int a, int b) {
    int dist = ping(a, b)+1, i, j;
	for (i=1;i<=N;i++) {
		if (i==a||i==b) continue;
		int tmp = ping(i,b);
		lis[tmp+1].push_back(i);
	}
	int here = a;
	for (i=dist-1;i>0;i--) {
		for (j=0;j<lis[i].size();j++) {
			if (ping(here,lis[i][j])==0) {
				travelTo(lis[i][j]);
				here=lis[i][j];
				break;
			}
		}
	}
	travelTo(b);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 5220 KB Output is correct
2 Correct 107 ms 5220 KB Output is correct
3 Correct 130 ms 5220 KB Output is correct
4 Correct 112 ms 5220 KB Output is correct
5 Correct 103 ms 5220 KB Output is correct
6 Correct 72 ms 5220 KB Output is correct
7 Correct 0 ms 5220 KB Output is correct
8 Correct 0 ms 5220 KB Output is correct
9 Correct 0 ms 5220 KB Output is correct
10 Correct 0 ms 5220 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 101 ms 5220 KB Output is correct
2 Correct 10 ms 5220 KB Output is correct
3 Correct 0 ms 5220 KB Output is correct
4 Correct 76 ms 5220 KB Output is correct
5 Correct 119 ms 5220 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 66 ms 5220 KB Output is correct
2 Correct 24 ms 5220 KB Output is correct
3 Correct 0 ms 5220 KB Output is correct
4 Correct 83 ms 5220 KB Output is correct
5 Correct 124 ms 5220 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 38 ms 5220 KB Output is correct
2 Correct 29 ms 5220 KB Output is correct
3 Correct 146 ms 5220 KB Output is correct
4 Correct 103 ms 5220 KB Output is correct
5 Correct 121 ms 5220 KB Output is correct