제출 #167961

#제출 시각아이디문제언어결과실행 시간메모리
167961lukameladzeCave (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
# include <bits/stdc++.h>
using namespace std;
int n,pr[100005],x[100005],le,ri,mid,pre[1000005],k,ans[1000005],idx,w;
void exploreCave(int N)
{
	n=N;
	for (int i=0; i<n; i++)
	{
		for (int j=0; j<n; j++)
		{
			if (pre[i]==-1) 
			x[i]=1;
			else
			x[i]=pre[i];
		}
		 idx=trycombinatoric(x);
		if (idx>i || idx==-1) 
		k=1;
		else k=0;
		le=0;
		ri=n-1;
		while (le<ri)
		{
			mid=(le+ri)/2;
			for (int j=le; j<=mid; j++)
			{
				if(pr[i]==-1) 
                  x[i]=k;
				else 
                  x[i]=pr[i];
			}
			for(int j=0; j<le; j++) 
			{
				if (pr[j]==-1)
				{
					if (k==1)
					{
						x[j]=0;
					}
					else
					x[j]=1;
				}
				else
				x[j]=pr[j];
			}
			for (int j=mid+1; j<n; j++)
			{
				if (pr[j]==-1)
				{
					if (k==1)
					{
						x[j]=0;
					}
					else
					x[j]=1;
				}
				else
				x[j]=pr[j];
			}
    		 idx=tryCombination(x);
    	if(idx>i || idx==-1)
    		ri=mid;
			else
			le=mid+1;
		}
		mid=(le+ri)/2;
		w=mid;
		ans[mid]=i;
		pr[mid]=k;
	}
	answer(pr,ans);
}

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:16:8: error: 'trycombinatoric' was not declared in this scope
    idx=trycombinatoric(x);
        ^~~~~~~~~~~~~~~
cave.cpp:60:12: error: 'tryCombination' was not declared in this scope
        idx=tryCombination(x);
            ^~~~~~~~~~~~~~
cave.cpp:71:2: error: 'answer' was not declared in this scope
  answer(pr,ans);
  ^~~~~~
cave.cpp:71:2: note: suggested alternative: 'ans'
  answer(pr,ans);
  ^~~~~~
  ans