답안 #12935

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
12935 2015-01-21T02:00:47 Z gs14004 컴퓨터 네트워크 (BOI14_network) C++
100 / 100
128 ms 5220 KB
#include <vector>
#include "network.h"
using namespace std;
  
vector<int> dist[1001];
  
void findRoute(int N, int a, int b){
  int l = ping(a,b) + 1;
  for(int i=1; i<=N; i++){
    if(b == i) continue;
    int l2 = ping(b,i) + 1;
    if(l <= l2) continue;
    dist[l - l2].push_back(i);
  }
  int p = a;
  for(int i=1; i<l; i++){
    for(int j=0; j<dist[i].size(); j++){
      if(ping(p,dist[i][j]) == 0){
        travelTo(dist[i][j]);
        p = dist[i][j];
        break;
      }
    }
  }
  travelTo(b);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 116 ms 5220 KB Output is correct
2 Correct 108 ms 5220 KB Output is correct
3 Correct 116 ms 5220 KB Output is correct
4 Correct 108 ms 5220 KB Output is correct
5 Correct 112 ms 5220 KB Output is correct
6 Correct 116 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 108 ms 5220 KB Output is correct
2 Correct 20 ms 5220 KB Output is correct
3 Correct 128 ms 5220 KB Output is correct
4 Correct 100 ms 5220 KB Output is correct
5 Correct 120 ms 5220 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 116 ms 5220 KB Output is correct
2 Correct 24 ms 5220 KB Output is correct
3 Correct 116 ms 5220 KB Output is correct
4 Correct 100 ms 5220 KB Output is correct
5 Correct 116 ms 5220 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 108 ms 5220 KB Output is correct
2 Correct 20 ms 5220 KB Output is correct
3 Correct 116 ms 5220 KB Output is correct
4 Correct 108 ms 5220 KB Output is correct
5 Correct 112 ms 5220 KB Output is correct