제출 #1365130

#제출 시각아이디문제언어결과실행 시간메모리
1365130mannshah1211이주 (IOI25_migrations)C++20
컴파일 에러
0 ms0 KiB
#include "migrations.h"
#include <bits/stdc++.h>

using namespace std;

vector<int> depth(n, 0);
int mx = 0, best = 0;

int send_message(int n, int i, int pi) {
  depth[i] = depth[pi] + 1;
  if (depth[i] > mx) {
    mx = depth[i];
    best = i;
  }
  if (i == n - 1) {
    return best;
  } else {
    return 0;
  }
}

pair<int, int> longest_path(vector<int> s) {
  return make_pair(0, s[s.size() - 1]);
}

컴파일 시 표준 에러 (stderr) 메시지

migrations.cpp:6:19: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 | vector<int> depth(n, 0);
      |                   ^
      |                   yn