Submission #16267

# Submission time Handle Problem Language Result Execution time Memory
16267 2015-08-19T06:43:13 Z eaststar Computer Network (BOI14_network) C++14
100 / 100
160 ms 5076 KB
#include "network.h"
int d[1010],ans[1010];
void findRoute(int n,int a,int b){
    int i,j,D;
    for(i=1;i<=n;++i)if(i!=a)d[i]=ping(a,i)+1;
    ans[D=d[b]]=b;
    for(i=d[b]-1;i;--i){
        for(j=1;j<=n;++j)if(d[j]==i&&!ping(b,j)){
            ans[i]=b=j;
            break;
        }
    }
    for(i=1;i<=D;++i)travelTo(ans[i]);
}
# Verdict Execution time Memory Grader output
1 Correct 114 ms 5076 KB Output is correct
2 Correct 104 ms 5076 KB Output is correct
3 Correct 110 ms 5076 KB Output is correct
4 Correct 66 ms 5076 KB Output is correct
5 Correct 114 ms 5076 KB Output is correct
6 Correct 100 ms 5076 KB Output is correct
7 Correct 0 ms 5076 KB Output is correct
8 Correct 0 ms 5076 KB Output is correct
9 Correct 0 ms 5076 KB Output is correct
10 Correct 0 ms 5076 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 70 ms 5076 KB Output is correct
2 Correct 21 ms 5076 KB Output is correct
3 Correct 155 ms 5076 KB Output is correct
4 Correct 76 ms 5076 KB Output is correct
5 Correct 125 ms 5076 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 109 ms 5076 KB Output is correct
2 Correct 22 ms 5076 KB Output is correct
3 Correct 128 ms 5076 KB Output is correct
4 Correct 63 ms 5076 KB Output is correct
5 Correct 160 ms 5076 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 102 ms 5076 KB Output is correct
2 Correct 30 ms 5076 KB Output is correct
3 Correct 139 ms 5076 KB Output is correct
4 Correct 71 ms 5076 KB Output is correct
5 Correct 139 ms 5076 KB Output is correct