Submission #151885

# Submission time Handle Problem Language Result Execution time Memory
151885 2019-09-05T09:56:36 Z Kamisama Computer Network (BOI14_network) C++14
0 / 100
115 ms 4344 KB
#include <cstdio>
#include <vector>
#include "network.h"
using namespace std;
const int maxn=1e3+7;

vector<int> disList[maxn],path;

void findRoute(int n, int a, int b){
  int pathLength=ping(a,b)+1;
  for(int i=1;i<=n;i++) if(i!=a && i!=b) disList[ping(a,i)].push_back(i);
  path.push_back(b);
  for(;pathLength>0;pathLength--){
    for(int c: disList[pathLength]) if(!ping(c,b)){
      b=c;
      path.push_back(b);
      break;
    }
  }
  for(int i=(int)path.size()-1;i>=0;i--) travelTo(path[i]);
}

Compilation message

grader.c: In function 'int main()':
grader.c:48:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf ("%d%d%d%d", &N, &a, &b, &M);
     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
grader.c:51:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d", &distance[u][v]);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 115 ms 4316 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 105 ms 4344 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 107 ms 4292 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 104 ms 4216 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -