Submission #47308

#TimeUsernameProblemLanguageResultExecution timeMemory
47308ista2000Computer Network (BOI14_network)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; // #define int long long int #include "network.h" void findRoute (int N, int a, int b) { /* * Obviously, this is not a good solution. * Replace it with your own code. */ vector<int> v(n); for(int i = 0;i<n;i++) if(i!=b-1) v[i] = ping(i+1, b); int cur = a-1; while(cur!=b-1) { for(int i = 0;i<n;i++) { if(v[i]==v[cur]-1) { int x = ping(cur+1, i+1); if(!x) { travelTo(i+1); cur = i; break; } } } } }

Compilation message (stderr)

network.cpp: In function 'void findRoute(int, int, int)':
network.cpp:14:19: error: 'n' was not declared in this scope
     vector<int> v(n);
                   ^
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]);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~