Submission #105972

#TimeUsernameProblemLanguageResultExecution timeMemory
105972xiaowuc1Computer Network (BOI14_network)C++14
100 / 100
175 ms8176 KiB
#include <algorithm> #include <cassert> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <vector> #include "network.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<int, pii> pipii; typedef vector<vector<ll>> matrix; void findRoute(int N, int a, int b) { map<int, int> distToB; for(int i = 1; i <= N; i++) { if(i == b) distToB[i] = 0; else distToB[i] = ping(i, b) + 1; } int curr = a; while(curr != b) { if(distToB[curr] == 1) { travelTo(b); break; } bool found = false; for(auto out: distToB) { if(distToB[curr] == 1 + out.second) { if(ping(curr, out.first) == 0) { travelTo(out.first); curr = out.first; found = true; break; } } } assert(found); } }

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...