제출 #247212

#제출 시각아이디문제언어결과실행 시간메모리
247212dantoh000로카히아 유적 (FXCUP4_lokahia)C++17
컴파일 에러
0 ms0 KiB
#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;
}

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

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);
                                                        ^~~~~~~~~~~~~