답안 #73176

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
73176 2018-08-28T02:54:34 Z TuGSGeReL 동굴 (IOI13_cave) C++14
0 / 100
344 ms 580 KB
#include "cave.h"
#include<bits/stdc++.h>
#define ll int
#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(ans,pos);
}

Compilation message

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;
       ~~~~~~^~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 207 ms 452 KB Answer is wrong
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 344 ms 580 KB Answer is wrong
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 384 KB Answer is wrong
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 384 KB Answer is wrong
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 207 ms 452 KB Answer is wrong
2 Halted 0 ms 0 KB -