Submission #79989

# Submission time Handle Problem Language Result Execution time Memory
79989 2018-10-17T21:02:31 Z giorgikob Cave (IOI13_cave) C++14
0 / 100
8 ms 512 KB
#include "cave.h"
#include<bits/stdc++.h>
int ans[50005],ans1[50005],S[50005],fix[50005];
void exploreCave(int N) {
    for(int i=0;i<N;i++)
    {
    	for(int j=0;j<N;j++)
    	if(fix[j]==1)
    	S[j]=ans[j];
    	else
    	S[j]=0;
    	
		int x=tryCombination(S);
		bool k=false;//daxuruli
		if(x==-1 || x>i)k=true;bool t=k;//ghia 
		int L=i,R=N-1,ind=N-1;
		while(L<=R)
		{
			int mid=(L+R)/2;
			for(int j=L;j<=mid;j++)
			if(fix[j]==0)
			S[j]=1-S[j];
			
			x=tryCombination(S);
			bool w=false;//daxuruli
			if(x==-1 || x>i)
			w=true;//ghia
			
			if(k!=w)
			R=mid;
			else
			L=mid+1;
			k=w;
		}
		ans1[L]=i;fix[L]=1;
		(t==true)?ans[L]=0:ans[L]=1;
		//if(ans[i]!=0)ans[i]=0;
	}
	
	answer(ans,ans1);
}

Compilation message

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:15:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   if(x==-1 || x>i)k=true;bool t=k;//ghia 
   ^~
cave.cpp:15:26: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   if(x==-1 || x>i)k=true;bool t=k;//ghia 
                          ^~~~
cave.cpp:16:17: warning: unused variable 'ind' [-Wunused-variable]
   int L=i,R=N-1,ind=N-1;
                 ^~~
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 512 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 384 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 512 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -