Submission #941973

# Submission time Handle Problem Language Result Execution time Memory
941973 2024-03-09T21:20:02 Z 4QT0R Cave (IOI13_cave) C++17
0 / 100
303 ms 348 KB
#include <bits/stdc++.h>
#include "cave.h"
using namespace std;

void exploreCave(int n){
	int cor[n];
	fill(cor,cor+n,-1);
	int pos[n];
	fill(pos,pos+n,-1);
	int S[n];
	int kolor,odp,l,p,md,cur=0;
	for (int i = 0; i<n; i++){
		for (int j = 0; j<n; j++){
			if (cor[j]>=0)S[j]=cor[j];
			else S[j]=0;
		}
		odp=tryCombination(S);
		if (odp==-1 || odp>i)kolor=0;
		else kolor=1;

		l=0,p=n-i;
		while(l<p){
			md=(l+p)/2;
			cur=0;
			for (int j = 0; j<n; j++){
				if (cor[j]>=0)S[j]=cor[j];
				else if (cur++<md)S[j]=kolor;
				else S[j]=kolor^1;
			}
			odp=tryCombination(S);
			if (odp==-1 || odp>i)p=md;
			else l=md+1;
		}
		cor[l]=kolor;
		pos[l]=i;
	}
	answer(cor,pos);
}
# Verdict Execution time Memory Grader output
1 Incorrect 128 ms 344 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 303 ms 344 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Answer is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 128 ms 344 KB Answer is wrong
2 Halted 0 ms 0 KB -