Submission #1105174

#TimeUsernameProblemLanguageResultExecution timeMemory
1105174jadai007Cave (IOI13_cave)C++17
13 / 100
10 ms528 KiB
#include "cave.h"
#include<bits/stdc++.h>
 
using namespace std;
 
void exploreCave(int N) {
    int state[N] = {0}, link[N] = {0};
    while(tryCombination(state) != -1){
        int wrong = -1, s = -1;
        for(int i = 0; i < N; ++i){
            int ft = tryCombination(state);
            state[i] = 1;
            int nd = tryCombination(state);
            if(ft == -1){
                state[i] = 0;
                break;
            }
            else if(nd == -1) break;
            if(ft != nd){
                if(wrong == ft) state[i] = 1;
                else if(wrong == nd) state[i] = 0;
            }
            else wrong = ft, s = i;
        }
    }
	for(int i = 0; i < N; ++i){
		state[i] = !state[i];
		int ck = tryCombination(state);
		link[i] = ck;
		state[i] = !state[i];
	}
	answer(state, link);
}

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:9:25: warning: variable 's' set but not used [-Wunused-but-set-variable]
    9 |         int wrong = -1, s = -1;
      |                         ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...