Submission #5981

# Submission time Handle Problem Language Result Execution time Memory
5981 2014-06-08T12:24:41 Z baneling100 Computer Network (BOI14_network) C++
50 / 100
124 ms 5220 KB
#include "network.h"
#include <vector>

using namespace std;

vector <int> A[1001];

int Dist;

void findRoute (int N, int a, int b)
{
    int i, j, k;

    Dist=ping(a,b);
    for(i=1 ; i<=N ; i++)
        if(i!=a && i!=b)
        {
            k=ping(i,b);
            if(k<Dist)
                A[Dist-ping(i,b)].push_back(i);
        }
    for(i=1 ; i<=Dist ; i++)
    {
        k=A[i].size();
        for(j=0 ; j<k ; j++)
            if(ping(a,A[i][j])==0)
            {
                travelTo(A[i][j]);
                a=A[i][j];
                break;
            }
    }
    travelTo(b);
}
# Verdict Execution time Memory Grader output
1 Incorrect 112 ms 5220 KB Output isn't correct - Too many calls to ping
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 116 ms 5220 KB Output is correct
2 Correct 24 ms 5220 KB Output is correct
3 Correct 124 ms 5220 KB Output is correct
4 Correct 104 ms 5220 KB Output is correct
5 Correct 116 ms 5220 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 112 ms 5220 KB Output is correct
2 Correct 24 ms 5220 KB Output is correct
3 Correct 120 ms 5220 KB Output is correct
4 Correct 100 ms 5220 KB Output is correct
5 Correct 116 ms 5220 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 108 ms 5220 KB Output isn't correct - Too many calls to ping
2 Halted 0 ms 0 KB -