제출 #301048

#제출 시각아이디문제언어결과실행 시간메모리
301048zecookiez컴퓨터 네트워크 (BOI14_network)C++17
100 / 100
130 ms11896 KiB
#include <bits/stdc++.h>
#include <network.h>
using namespace std;
template<class C>constexpr int len(const C&c){return int(c.size());}
 
const int MAXN = 1001;
vector<int> dist[MAXN];
int memo[MAXN][MAXN];

int pong(int a, int b){
    if(memo[a][b] != -1) return memo[a][b];
    return memo[a][b] = memo[b][a] = ping(a, b);
}

void findRoute(int N, int a, int b){
    memset(memo, -1, sizeof(memo));
    int c = pong(a, b); dist[c].push_back(b);
    for(int v, i = 1; i <= N; ++i){
        if(i == a) continue;
        v = pong(a, i);
        if(v < c) dist[v].push_back(i);
    }
    vector<int> ans = {b};
    for(int x = c - 1; x >= 0; --x){
        for(int nxt : dist[x]){
            if(pong(ans.back(), nxt) == 0){
                ans.push_back(nxt);
                break;
            }
        }
    }
    reverse(ans.begin(), ans.end());
    for(int i : ans) travelTo(i);
}

컴파일 시 표준 에러 (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...