Submission #81050

# Submission time Handle Problem Language Result Execution time Memory
81050 2018-10-23T15:48:40 Z xiaowuc1 Computer Network (BOI14_network) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>

/*
unsigned seed1 = std::chrono::system_clock::now().time_since_epoch().count();
mt19937 g1.seed(seed1);

ios_base::sync_with_stdio(false);
cin.tie(NULL);
*/
using namespace std;

const double PI = 2 * acos(0);

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<int, ll> pill;
typedef pair<ll, ll> pll;
typedef long double ld;
typedef vector<vector<ll>> matrix;

bool used[1005];
void solve(int n, int a, int b, int d) {
  if(d == 0) {
    travelTo(b);
    return;
  }
  for(int k = 1; k <= n; k++) {
    if(used[k]) continue;
    int d1 = ping(a, k);
    int d2 = ping(k, b);
    used[k] = true;
    if(d1 + d2 + 1 == d) {
      solve(n, a, k, d1);
      solve(n, k, b, d2);
      return;
    }
  }
  assert(false);
}

void findRoute(int n, int a, int b) {
  memset(used, 0, sizeof(used));
  int dd = ping(a, b);
  used[a] = true;
  used[b] = true;
  solve(n, a, b, dd);
}

Compilation message

network.cpp: In function 'void solve(int, int, int, int)':
network.cpp:25:5: error: 'travelTo' was not declared in this scope
     travelTo(b);
     ^~~~~~~~
network.cpp:30:14: error: 'ping' was not declared in this scope
     int d1 = ping(a, k);
              ^~~~
network.cpp:30:14: note: suggested alternative: 'pill'
     int d1 = ping(a, k);
              ^~~~
              pill
network.cpp: In function 'void findRoute(int, int, int)':
network.cpp:44:12: error: 'ping' was not declared in this scope
   int dd = ping(a, b);
            ^~~~
network.cpp:44:12: note: suggested alternative: 'pill'
   int dd = ping(a, b);
            ^~~~
            pill
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]);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~