Submission #1007348

# Submission time Handle Problem Language Result Execution time Memory
1007348 2024-06-24T16:30:08 Z Ludissey Computer Network (BOI14_network) C++14
0 / 100
76 ms 11708 KB
#include "network.h"
#include <bits/stdc++.h>
#define sz(a) (int)a.size()
#define all(a) a.begin(), a.end()
 
using namespace std;

void findRoute (int N, int a, int b)
{
    int d=ping(a,b);
    vector<vector<int>> prox(d);
    for (int i = 1; i <= N; i++) { 
        if(i!=a&&i!=b) { 
            prox[ping(i,b)].push_back(i);
        }
    } 
    int x=a;
    for (int i = d-1; i >= 0; i--){
        for (auto u : prox[i])
        {
            if(ping(x,u)==0) { x=u; travelTo(x); break;}
        }
    }
    travelTo(b);
}

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]
   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 time Memory Grader output
1 Correct 54 ms 8100 KB Output is correct
2 Runtime error 56 ms 11708 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 76 ms 10832 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 56 ms 10832 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 55 ms 11092 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -