Submission #29866

# Submission time Handle Problem Language Result Execution time Memory
29866 2017-07-21T09:34:01 Z dereotu Cave (IOI13_cave) C++14
0 / 100
185 ms 700 KB
#include "cave.h"
#include <bits/stdc++.h>
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define st first
#define nd second
#define forr(i,A,B) for(int i=A;i<B;++i)
#define space ' '
#define endl '\n'
#define LL long long
using namespace std;

void exploreCave(int N) {
    int a[N]={0},ans[N],done[N];
    memset(ans,-1,sizeof ans);
    memset(done,-1,sizeof done);
    int last=tryCombination(a);
    forr(j,0,N){
	    forr(i,0,N){
	    	if(done[i]!=-1) continue;
	    	a[i]=1;
	    	int res=tryCombination(a);
	    	if(res==-1){
	    		a[i]=0;
	    		int wtf=tryCombination(a);
	    		ans[i]=wtf;
	    		a[i]=1;
	    		done[i]=1;
	    		continue;
	    	}
	    	if(res!=last){
	    		if(last>res){
	    			a[i]=0;
	    			ans[i]=res;
	    			done[i]=1;
	    		}
	    		else{ 
	    			ans[i]=last;
	    			a[i]=1;
	    			done[i]=1;
	    			last=res;
	    		}
	    	}
	    	else{
	    		a[i]=0;
	    	}
	    }	
    }
    forr(i,0,N){
    	assert(ans[i]!=-1);
    }
    answer(a,ans);

}
# Verdict Execution time Memory Grader output
1 Runtime error 185 ms 700 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 512 KB too much calls on tryCombination()
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 6 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 6 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 185 ms 700 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -