Submission #474239

#TimeUsernameProblemLanguageResultExecution timeMemory
474239MB2동굴 (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll S[5009],D[5009];
bool fix[5009];
void swp(ll x, ll y)
{
	for(ll i=x; i<=y; i++)
	{
		if(!fix[i])
		S[i]^=1;
	}
}
ll search(ll cur, ll n)
{
	ll r=n-1,l=0;
	if(tryCombination(S)!=cur)
	swp(0,n-1);
	while(r!=l)
	{
		ll mid=(l+r)/2;
		swp(l,mid);
		ll inf=tryCombination(S);
		swp(l,mid);
		if(inf==cur)
		l=mid+1;
		else
		r=mid;
	}
	return r;
}
void exploreCave(ll x)
{
	for(ll i=0; i<x; i++)
	{
		ll cur=search(i,x);
		fix[cur]=true;
		S[cur]^=1;
		D[cur]=1;
	}
	answer(S,D);
}

Compilation message (stderr)

cave.cpp: In function 'long long int search(long long int, long long int)':
cave.cpp:17:5: error: 'tryCombination' was not declared in this scope
   17 |  if(tryCombination(S)!=cur)
      |     ^~~~~~~~~~~~~~
cave.cpp:23:10: error: 'tryCombination' was not declared in this scope
   23 |   ll inf=tryCombination(S);
      |          ^~~~~~~~~~~~~~
cave.cpp: In function 'void exploreCave(long long int)':
cave.cpp:41:2: error: 'answer' was not declared in this scope
   41 |  answer(S,D);
      |  ^~~~~~