# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
41128 | 14kg | Computer Network (BOI14_network) | C++11 | 150 ms | 58656 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "network.h"
#include <algorithm>
using namespace std;
int out_len, d_len, out[1001];
pair<int,int> d[1001];
void findRoute(int n, int s, int e){
int out_w;
out_len=ping(s,e)+1;
out_w=out_len-1, out[out_w+1]=e;
for(int i=1; i<=n; i++)
if(i!=s && i!=e) d[++d_len]={ping(s,i),i};
sort(d+1,d+d_len+1);
for(int i=d_len; i>=1; i--){
if(out_w<=d[i].first) continue;
if(d[i].first+ping(d[i].second,out[out_w+1])==out_w-1){
out[out_w]=d[i].second, out_w--;
}
}
for(int i=1; i<=out_len; i++) travelTo(out[i]);
}
Compilation message (stderr)
# | 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... |