Submission #1314848

#TimeUsernameProblemLanguageResultExecution timeMemory
1314848Zone_zoneeComputer Network (BOI14_network)C++20
100 / 100
51 ms4384 KiB
#include <bits/stdc++.h>
#include "network.h"

void findRoute (int N, int a, int b)
{
    using namespace std;
    vector<int> dist[N];
    for(int i = 1; i <= N; ++i){
        if(i != b) dist[ping(b, i)].push_back(i);
    }
    int u = a;
    int d = ping(a, b);
    while(u != b && d > 0){
        for(int v : dist[d-1]){
            if(ping(u, v) == 0){
                d--;
                u = v;
                travelTo(v);
                break;
            }
        }
    }
    travelTo(b);
}

Compilation message (stderr)

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]
   48 |     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]
   51 |             scanf("%d", &distance[u][v]);
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...