이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "network.h"
#include <map>
using namespace std;
map<int,int> path;
map<int,int>::iterator it;
void findRoute (int n, int a, int b)
{
/*
* Obviously, this is not a good solution.
* Replace it with your own code.
*/
int dist = ping(a, b);
int x,y;
path[dist+1]=b;
int i;
for(i=1;i<=n;i++){
if(i==a || i==b) continue;
x=ping(a,i);
if(path.find(x+1)!=path.end()) continue;
path[x+1]=i;
it=path.find(x+1);
it++;
y=ping(i,it->second);
if(it->first != x+y+2){
path.erase(x+1);
}
}
for(it=path.begin(); it!=path.end(); it++){
travelTo(it->second);
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |