Submission #985413

#TimeUsernameProblemLanguageResultExecution timeMemory
985413SzymonKrzywdaCave (IOI13_cave)C++17
0 / 100
1 ms348 KiB
#include"cave.h" #include <bits/stdc++.h> using namespace std; int tryCombination(int S[]); void answer(int S[],int D[]); void exploreCave(int N){ int D[N],S[N],w=0,w_2=0; for (int i=0; i<N; i++) D[i] = -1; bool good[N]; //int S_2[N]; // 0 0 0 0 0 // 1 1 1 1 1 // 1 1 1 1 0 //1110 //3102 for (int i=0; i<N; i++){ w = tryCombination(S); if (!(w == -1 || w > i)){ for (int i=0; i<N; i++){ if (D[i] == -1) S[i] = (S[i]+1)%2; } //w = tryCombination(S); } //cout << i << " "<< w << endl; //if(w==-1) break; //if (w > i) continue; for (int j=0; j<N; j++){ S[j] = (S[j]+1)%2; w_2 = tryCombination(S); if (w_2 == i){ D[j] = i; S[j] = (S[j]+1)%2; break; } S[j] = (S[j]+1%2); } } answer(S,D); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:11:10: warning: unused variable 'good' [-Wunused-variable]
   11 |     bool good[N];
      |          ^~~~
#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...