Submission #1298436

#TimeUsernameProblemLanguageResultExecution timeMemory
1298436gesp3011v2Cave (IOI13_cave)C++20
Compilation error
0 ms0 KiB
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;

void exploreCave(int N){
int a[N];
memset(a,0,sizeof a);
int b[n];
for(int i=0;i<n;i++){
	int x=tryCombination(a);
	if(x==-1)break;
    for(int j=0;j<n;j++){
    if(a[j]==1)continue;
    a[j]=1;
    int y=tryCombination(a);
    a[j]=0;
    if(y>x || y==-1){
        a[j]=1;
        break;
    }
}
}
//int z=tryCombination(a);
for(int i=0;i<n;i++){
    a[i]=abs(a[i]-1);
    int x=tryCombination(a);
    a[i]=abs(a[i]-1);
    b[i]=x;
}	
answer(a,b);
}

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:8:7: error: 'n' was not declared in this scope
    8 | int b[n];
      |       ^
cave.cpp:28:5: error: 'b' was not declared in this scope
   28 |     b[i]=x;
      |     ^
cave.cpp:30:10: error: 'b' was not declared in this scope
   30 | answer(a,b);
      |          ^