QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#621855#8650. Island Hoppinghhoppitree#Compile Error//C++17304b2024-10-08 17:37:212024-10-08 17:37:22

Judging History

你现在查看的是最新测评结果

  • [2024-10-08 17:37:22]
  • 评测
  • [2024-10-08 17:37:21]
  • 提交

answer

#include "island.h"
#include <bits/stdc++.h>

using namespace std;

const int N = 505;

int vis[N];

void dfs(int x, int fa) {
    for (int i = 1, v; ; ++i) {
        if ((v = query(i, n)) == fa) break;
        answer(x, v), dfs(v, x);
    }
}

void solve(int n, int) {
    dfs(n, 0);
}

Details

answer.code: In function ‘void dfs(int, int)’:
answer.code:12:27: error: ‘n’ was not declared in this scope
   12 |         if ((v = query(i, n)) == fa) break;
      |                           ^