Submission #752438

#TimeUsernameProblemLanguageResultExecution timeMemory
752438jamielimComputer Network (BOI14_network)C++14
0 / 100
91 ms4288 KiB
#include "network.h" #include <bits/stdc++.h> using namespace std; #define fi first #define se second #define mp make_pair #define pb emplace_back typedef long long ll; typedef pair<int,int> ii; const int INF=1012345678; int dista[1005]; set<int> found; void findRoute (int N, int a, int b){ int d=ping(a,b)+1; found.insert(0); found.insert(d); memset(dista,-1,sizeof(dista)); dista[0]=a; dista[d]=b; for(int i=1;i<=N;i++){ if(i==a||i==b)continue; int x=ping(i,a)+1; if(dista[x]!=-1)continue; auto it=found.upper_bound(x); int y=ping(i,dista[*it])+1; if(x+y==(*it)){ dista[x]=i; found.insert(x); } } for(int i=0;i<=d;i++)travelTo(dista[i]); }

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