답안 #247212

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
247212 2020-07-11T08:01:29 Z dantoh000 로카히아 유적 (FXCUP4_lokahia) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
//#include "lokahia.h"
int Q[205][205];
int query(int i, int j){
    if (i == j) return Q[i][i] = i;
    else if (Q[i][j] == -1) return Q[i][j] = Q[j][i] = CollectRelics(i,j);
    else return Q[i][j];
}
int FindBase(int N){
    memset(Q,-1,sizeof(Q));
	int cur = 0;
	vector<int> pos;
	for (int i = 0; i < N; i++){
        int q = query(0,i);
        if (q != -1) pos.push_back(i);
	}
	for (auto x : pos){
        int q = query(cur,x);
        if (q != -1 && q > cur) cur = q;
	}
    /*int ct = 0;
    for (int i = 0; i < N; i++){
        if (i == cur || query(i,cur) != -1) ct++;
        if (ct > N/2) break;
    }*/
    return cur;
}

Compilation message

lokahia.cpp: In function 'int query(int, int)':
lokahia.cpp:7:56: error: 'CollectRelics' was not declared in this scope
     else if (Q[i][j] == -1) return Q[i][j] = Q[j][i] = CollectRelics(i,j);
                                                        ^~~~~~~~~~~~~