답안 #216932

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
216932 2020-03-28T13:23:29 Z rajarshi_basu 컴퓨터 네트워크 (BOI14_network) C++14
0 / 100
133 ms 4344 KB
#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(d + v + 1 == dist){
                currNode = e;
                inters.pb(e);
                break;
            }
        }
    }
    inters.pb(b);
    for(auto e : inters){
        travelTo(e);
    }
}

Compilation message

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]);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 133 ms 4344 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 117 ms 4344 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 118 ms 4272 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 120 ms 4292 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -