Submission #1328382

#TimeUsernameProblemLanguageResultExecution timeMemory
1328382vahagng컴퓨터 네트워크 (BOI14_network)C++20
Compilation error
0 ms0 KiB
#include "network.h"
#include <bits/stdc++.h>
using namespace std;


void findRoute(int N, int a, int b)
{
    int d = ping(a, b);
    vector<pair<int, int>>v;
    for(int i = 1; i <= N; i++){
        if (i == a || i == b) continue;
        int d1 = ping(a, i);
        int d2 = ping(i, b);
        if (d1 + d2 == d - 1) {
            v.push_back({ d1, i });
        }
    }
    if (v.empty()) {
        travelTo(b);
        return;
    }
    sort(v.begin(), v.end());
    int c = 0;
    for (auto [dd, node] : v) {
        if (dd == c) {
            travelTo(node);
        }
    }
    travelTo(b)
}

Compilation message (stderr)

network.cpp: In function 'void findRoute(int, int, int)':
network.cpp:29:16: error: expected ';' before '}' token
   29 |     travelTo(b)
      |                ^
      |                ;
   30 | }
      | ~               
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]);
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~