Submission #752467

#TimeUsernameProblemLanguageResultExecution timeMemory
752467125259Computer Network (BOI14_network)C++17
25 / 100
87 ms4216 KiB
#include "network.h" #include <bits/stdc++.h> using namespace std; vector<int>v; bool visited[1005]; void f(int n, int s, int e, int dist){ if(dist==0) {v.push_back(e); visited[e]=1; return;} for(int i=1; i<=n; i++){ if(i==s or i==e or visited[i]) continue; int d1=ping(s,i), d2=ping(i,e); if(d1 + d2 == dist-1){ f(n,s,i,d1); f(n,i,e,d2); break; } } } void findRoute (int n, int a, int b){ int dist = ping(a, b); f(n,a,b,dist); for(int i=0; i<v.size(); i++) travelTo(v[i]); }

Compilation message (stderr)

network.cpp: In function 'void findRoute(int, int, int)':
network.cpp:24:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |     for(int i=0; i<v.size(); i++) travelTo(v[i]);
      |                  ~^~~~~~~~~
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...