답안 #105971

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
105971 2019-04-16T03:11:32 Z xiaowuc1 컴퓨터 네트워크 (BOI14_network) C++14
0 / 100
156 ms 8060 KB
#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);
					found = true;
					break;
				}
			}
		}
		assert(found);
	}
}

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 112 ms 8060 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 156 ms 6892 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 109 ms 6896 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 118 ms 6776 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -