Submission #456272

#TimeUsernameProblemLanguageResultExecution timeMemory
456272fuad27Cave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
        #include "cave.h"
    	#include<bits/stdc++.h>
    	using namespace std;
	void p25(int N) {
		void exploreCave(int N) {
	int S[N+1];
	int t[N+1];
	for(int i = 0 ; i < N ; ++i) S[i] = 0, t[i] = i;
	int val = tryCombination(S);
	if(val == -1)
	{
		for(int i = 0 ; i < N ; ++i){
			S[i] = 1;
			t[i] = tryCombination(S);
			S[i] = 0;
		}
		}	
	else{
		while(val != -1) {
			S[val] = !S[val];
			val = tryCombination(S);
		}
	}
	answer(S, t);
}
	}
        void p34(int N) {
          int S[N], D[N]; int l = 0;
          for (int i = 0; i < N; i++) S[i] = 0;
          while (l != -1) {
            l = tryCombination(S);
            for (int i = 0; i < N; i++) {
              S[i] = (S[i] - 1)*(S[i] - 1);
              int a = tryCombination(S);
              if (a > l || a == -1) {
                l = a;
                break;
              }
              S[i] = (S[i] - 1)*(S[i] - 1);
            }
          }
          for (int i = 0; i < N; i++) {
            S[i] = (S[i] - 1)*(S[i] - 1);
            D[i] = tryCombination(S);
            S[i] = (S[i] - 1)*(S[i] - 1);
          }
          answer(S, D);
        }
	void exploreCave(int N) {
		p34(N);
		p25(N);
	}

Compilation message (stderr)

cave.cpp: In function 'void p25(int)':
cave.cpp:5:27: error: a function-definition is not allowed here before '{' token
    5 |   void exploreCave(int N) {
      |                           ^