답안 #16368

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
16368 2015-08-21T16:54:37 Z suhgyuho_william 컴퓨터 네트워크 (BOI14_network) C++
25 / 100
160 ms 5200 KB
#include "network.h"
#include <map>
using namespace std;

map<int,int> mp;
map<int,int>::iterator it;

void findRoute (int n, int a, int b)
{
    int dist = ping(a, b);
    int x,y;
    int i;

    mp[dist+1]=b;
    for(i=1;i<=n;i++){
        if(i==a || i==b) continue;
        x=ping(a,i);
        if(x >= dist) continue;
        if(mp.find(x+1) != mp.end() ) continue;
        mp[x+1]=i;
        it=mp.find(x+1);
        it++;
        y=ping(i,it->second);
        if(it->first != (x+1) + (y+1) ){
            it--;
            mp.erase(it);
        }
    }

    for(it=mp.begin(); it!=mp.end(); it++){
        travelTo(it->second);
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 160 ms 5200 KB Output is correct
2 Correct 107 ms 5200 KB Output is correct
3 Correct 125 ms 5200 KB Output is correct
4 Correct 107 ms 5200 KB Output is correct
5 Correct 102 ms 5200 KB Output is correct
6 Correct 72 ms 5200 KB Output is correct
7 Correct 0 ms 5200 KB Output is correct
8 Correct 0 ms 5200 KB Output is correct
9 Correct 0 ms 5200 KB Output is correct
10 Correct 0 ms 5200 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 81 ms 5200 KB Output isn't correct - Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 64 ms 5200 KB Output isn't correct - Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 106 ms 5200 KB Output isn't correct - Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -