Submission #216937

#TimeUsernameProblemLanguageResultExecution timeMemory
216937rajarshi_basuComputer Network (BOI14_network)C++14
100 / 100
144 ms5116 KiB
#include <iostream> #include <iomanip> #include <stdio.h> #include <string> #include <vector> #include <cmath> #include "network.h" #define FOR(i,n) for(int i=0;i<n;i++) #define FORE(i,a,b) for(int i=a;i<=b;i++) #define ll long long int #define ld long double #define vi vector<int> #define pb push_back #define ff first #define ss second #define ii pair<int,int> #define iii pair<int,ii> #define vv vector using namespace std; const int MAXN = 1001; vector<int> dists[MAXN]; void findRoute(int n,int a,int b){ int dist = ping(a,b); FORE(i,1,n){ if(i == a or i == b)continue; dists[ping(i,b)].pb(i); } vi inters; int currNode = a; for(int d = dist-1;d>=0;d--){ for(auto e: dists[d]){ int v = ping(currNode,e); if(v == 0){ currNode = e; inters.pb(e); break; } } } inters.pb(b); for(auto e : inters){ travelTo(e); } }

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]
     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]);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...