Submission #425788

#TimeUsernameProblemLanguageResultExecution timeMemory
425788ApiramCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include "cave.h"
#include<bits/stdc++.h>
using namespace std;
void exploreCave(int N) {
    //trycombination(s);
    vector<int>arr(n,0);
    vector<int>d(n);
    vector<int>ans;
    for (int i =0;i<n;++i){
    	ans.push_back(arr[i]);
    	int a = trycombination(ans);
    	if (a==-1){
    	ans.pop_back();
    	ans.push_back(flip(arr[i]));
    	a=trycombination(ans);}
    	arr[i]=flip(ans.back());
    	d[i]=a;
    	ans.pop_back();
    	ans.push_back(arr[i]);
    }
    answer(arr,d);
}

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:6:20: error: 'n' was not declared in this scope
    6 |     vector<int>arr(n,0);
      |                    ^
cave.cpp:11:14: error: 'trycombination' was not declared in this scope; did you mean 'tryCombination'?
   11 |      int a = trycombination(ans);
      |              ^~~~~~~~~~~~~~
      |              tryCombination
cave.cpp:14:20: error: 'flip' was not declared in this scope
   14 |      ans.push_back(flip(arr[i]));
      |                    ^~~~
cave.cpp:16:13: error: 'flip' was not declared in this scope
   16 |      arr[i]=flip(ans.back());
      |             ^~~~
cave.cpp:21:12: error: cannot convert 'std::vector<int>' to 'int*'
   21 |     answer(arr,d);
      |            ^~~
      |            |
      |            std::vector<int>
In file included from cave.cpp:1:
cave.h:9:17: note:   initializing argument 1 of 'void answer(int*, int*)'
    9 | void answer(int S[], int D[]);
      |             ~~~~^~~