Submission #5951

# Submission time Handle Problem Language Result Execution time Memory
5951 2014-06-06T08:30:57 Z model_code Computer Network (BOI14_network) C++
100 / 100
124 ms 5072 KB
#include "network.h"
const int MAX_N = 1000;

void findRoute (int N, int a, int b)
{
    int db[MAX_N], i, x = a;
    for (i = 0; i < N; i++) db[i] = (i+1 == b) ? 0 : (ping(i+1, b) + 1);
    while (db[x-1]) {
        for (i = 0; i < N; i++) 
            if (db[i] == db[x-1] - 1 && ping(i+1, x) == 0) {
                x = i+1;
                travelTo (x);
                break;
            }
    }
}
# Verdict Execution time Memory Grader output
1 Correct 112 ms 5072 KB Output is correct
2 Correct 112 ms 5072 KB Output is correct
3 Correct 100 ms 5072 KB Output is correct
4 Correct 112 ms 5072 KB Output is correct
5 Correct 108 ms 5072 KB Output is correct
6 Correct 92 ms 5072 KB Output is correct
7 Correct 0 ms 5072 KB Output is correct
8 Correct 0 ms 5072 KB Output is correct
9 Correct 0 ms 5072 KB Output is correct
10 Correct 0 ms 5072 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 108 ms 5072 KB Output is correct
2 Correct 24 ms 5072 KB Output is correct
3 Correct 116 ms 5072 KB Output is correct
4 Correct 104 ms 5072 KB Output is correct
5 Correct 124 ms 5072 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 108 ms 5072 KB Output is correct
2 Correct 28 ms 5072 KB Output is correct
3 Correct 112 ms 5072 KB Output is correct
4 Correct 104 ms 5072 KB Output is correct
5 Correct 120 ms 5072 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 116 ms 5072 KB Output is correct
2 Correct 28 ms 5072 KB Output is correct
3 Correct 116 ms 5072 KB Output is correct
4 Correct 96 ms 5072 KB Output is correct
5 Correct 124 ms 5072 KB Output is correct