답안 #16057

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
16057 2015-08-12T09:15:50 Z tonyjjw 컴퓨터 네트워크 (BOI14_network) C++14
100 / 100
161 ms 5220 KB
#include<vector>
#include "network.h"
#define MN 1000
  
using namespace std;
  
vector<int> A[MN+1];
int d[MN+1];
  
void findRoute(int N,int a,int b){
  for(int i=1;i<=N;i++){
    if(i!=b){
	    d[i]=ping(i,b)+1;
    }
    else{
    	d[i]=0;
    }
    A[d[i]].push_back(i);
  }
  while(a!=b){
    for(auto n:A[d[a]-1]){
      if(ping(a,n)==0){
        travelTo(n);
        a=n;
        break;
      }
    }
  }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 100 ms 5220 KB Output is correct
2 Correct 87 ms 5220 KB Output is correct
3 Correct 103 ms 5220 KB Output is correct
4 Correct 126 ms 5220 KB Output is correct
5 Correct 76 ms 5220 KB Output is correct
6 Correct 73 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 60 ms 5220 KB Output is correct
2 Correct 31 ms 5220 KB Output is correct
3 Correct 133 ms 5220 KB Output is correct
4 Correct 79 ms 5220 KB Output is correct
5 Correct 87 ms 5220 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 77 ms 5220 KB Output is correct
2 Correct 19 ms 5220 KB Output is correct
3 Correct 119 ms 5220 KB Output is correct
4 Correct 86 ms 5220 KB Output is correct
5 Correct 161 ms 5220 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 115 ms 5220 KB Output is correct
2 Correct 17 ms 5220 KB Output is correct
3 Correct 132 ms 5220 KB Output is correct
4 Correct 94 ms 5220 KB Output is correct
5 Correct 128 ms 5220 KB Output is correct