제출 #73174

#제출 시각아이디문제언어결과실행 시간메모리
73174TuGSGeReL동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
#include "cave.h"
#include<bits/stdc++.h>
#define ll long long
#define mp make_pair
#define pub push_back
#define pob pop_back
#define ss second
#define ff first
#define ext exit(0)
using namespace std;
ll i,j,ans[5001],pos[5001],ask[5001],k,l,r;
bool boo[5001];
void exploreCave(int n) {
	memset(boo,-1,sizeof boo);
	for(i=0;i<n;i++){
		for(j=0;j<n;j++){
			if(boo[i]==-1) ask[i]=0;
			else ask[i]=ans[i];
		}
		k=tryCombination(ask);
		if(k!=i) ans[i]=ask[i];
		else ans[i]=1-ask[i];
		l=0,r=n;
		while(l+1<r){
			ll mid=(l+r)/2;
			for(j=0;j<n;j++){
				if(j<=mid) ask[i]=ans[i];
				else ask[i]=1-ans[i];
			}
			k=tryCombination(ask);
			if(k!=i){
				l=mid;
			}
			else r=mid;
		}
		pos[i]=l;
	}
	answer()
}

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:17:13: warning: comparison of constant '-1' with boolean expression is always false [-Wbool-compare]
    if(boo[i]==-1) ask[i]=0;
       ~~~~~~^~~~
cave.cpp:20:23: error: cannot convert 'long long int*' to 'int*' for argument '1' to 'int tryCombination(int*)'
   k=tryCombination(ask);
                       ^
cave.cpp:30:24: error: cannot convert 'long long int*' to 'int*' for argument '1' to 'int tryCombination(int*)'
    k=tryCombination(ask);
                        ^
cave.cpp:38:9: error: too few arguments to function 'void answer(int*, int*)'
  answer()
         ^
In file included from cave.cpp:1:0:
cave.h:9:6: note: declared here
 void answer(int S[], int D[]);
      ^~~~~~