답안 #5982

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
5982 2014-06-08T12:27:20 Z baneling100 컴퓨터 네트워크 (BOI14_network) C++
100 / 100
116 ms 5220 KB
#include "network.h"
#include <vector>

using namespace std;

vector <int> A[1001];

int Dist;

void findRoute (int N, int a, int b)
{
    int i, j, k;

    Dist=ping(a,b);
    for(i=1 ; i<=N ; i++)
        if(i!=a && i!=b)
        {
            k=ping(i,b);
            if(k<Dist)
                A[Dist-k].push_back(i);
        }
    for(i=1 ; i<=Dist ; i++)
    {
        k=A[i].size();
        for(j=0 ; j<k ; j++)
            if(ping(a,A[i][j])==0)
            {
                travelTo(A[i][j]);
                a=A[i][j];
                break;
            }
    }
    travelTo(b);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 116 ms 5220 KB Output is correct
2 Correct 112 ms 5220 KB Output is correct
3 Correct 100 ms 5220 KB Output is correct
4 Correct 100 ms 5220 KB Output is correct
5 Correct 92 ms 5220 KB Output is correct
6 Correct 108 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 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 28 ms 5220 KB Output is correct
3 Correct 108 ms 5220 KB Output is correct
4 Correct 104 ms 5220 KB Output is correct
5 Correct 108 ms 5220 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 104 ms 5220 KB Output is correct
2 Correct 28 ms 5220 KB Output is correct
3 Correct 108 ms 5220 KB Output is correct
4 Correct 100 ms 5220 KB Output is correct
5 Correct 112 ms 5220 KB Output is correct