Submission #1273771

#TimeUsernameProblemLanguageResultExecution timeMemory
1273771hgmhcComputer Network (BOI14_network)C++20
100 / 100
51 ms4420 KiB
#include <bits/stdc++.h>
#include"network.h"
using namespace std; using ll = long long; using ii = pair<ll,ll>; using vi = vector<ll>;
#define rep(i,a,b) for (ll i = (a); i <= (b); ++i)
#define per(i,a,b) for (ll i = (b); i >= (a); --i)
#define all(x) (x).begin(), (x).end()
#define siz(x) ll((x).size())
#define Mup(x,y) (x = max(x,y))
#define mup(x,y) (x = min(x,y))
#define fi first
#define se second
#define pb push_back
#define dbg(...) fprintf(stderr,__VA_ARGS__)

const ll N = 1003;
vi L[N];
ll d;
stack<ll>t;

void findRoute(int n, int a, int b) {
    rep(i,1,n)if(i!=a){
        ll p=ping(a,i);
        L[p].push_back(i);
        if(i==b){
            d=p,t.push(b);
        }
    }
    per(i,0,d-1){
        for(auto j:L[i]){
            if(!ping(j,b)){
                t.push(j),b=j;
                break;
            }
        }
    }
    for(;siz(t);t.pop()){
        travelTo(t.top());
    }
}

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