제출 #1263227

#제출 시각아이디문제언어결과실행 시간메모리
1263227bluevioletCave (IOI13_cave)C++20
컴파일 에러
0 ms0 KiB
#include             <bits/stdc++.h>
    
#define             ll   long long
#define          io(x)   if (fopen(x".inp","r")) {freopen(x".inp","r",stdin),freopen(x".out","w",stdout);}
#define        TimeRun   {End=clock();cerr<<"Time run: "<<(float)(End-Begin)/CLOCKS_PER_SEC<<"s"<<el;}
#define      mem(c, x)   memset(c, x, sizeof(c))
#define         all(c)   c.begin(), c.end()
#define       bit(i,j)   ((i >> j) & 1)
#define             se   second     
#define             fi   first
#define             el   '\n'
using namespace std;  

template<class X, class Y> bool maximize(X &a, const Y &b) { return (a < b ? a = b, 1 : 0); }
template<class X, class Y> bool minimize(X &a, const Y &b) { return (a > b ? a = b, 1 : 0); }

int dx[8] = {0, 1, 0,-1, 1, 1,-1,-1};
int dy[8] = {1, 0,-1, 0, 1,-1,-1, 1};
const int  maxn  = 1e5 + 9;
const int  Inf   = 2e9 + 7;
const ll   Infll = 1e18 + 9;
const ll   Mod   = 1e9 + 7;
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
set<int> st;
int s[maxn], D[maxn];


void exploreCave(int N) {
	int n = N;

	for (int i=0; i<n; i++) st.insert(i);

	while (1) {
		int firstClosed = tryCombination(s);

		if (firstClosed == -1) break;

		for (auto id=st.begin(); id!=st.end(); ) {
			int pos = *id;
			s[pos] ^= 1;
			int pp = tryCombination(s);
			if (pp == -1) break;
			if (pp < firstClosed) {
				s[pos] ^= 1;
				D[pos] = pp;
				++id;
				st.erase(pos);
			} else
			if (pp > firstClosed) {
				++id;
				D[pos] = firstClosed;
				st.erase(pos);
				break;
			} else { // pp == firstClosed
				++id;
				s[pos] ^= 1;
			}
		}
	}
	answer(s, D);
}

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:34:35: error: 'tryCombination' was not declared in this scope
   34 |                 int firstClosed = tryCombination(s);
      |                                   ^~~~~~~~~~~~~~
cave.cpp:60:9: error: 'answer' was not declared in this scope
   60 |         answer(s, D);
      |         ^~~~~~