Submission #265363

# Submission time Handle Problem Language Result Execution time Memory
265363 2020-08-14T16:28:39 Z arayi Ancient Books (IOI17_books) C++17
Compilation error
0 ms 0 KB
#include "books.h"
#include <bits/stdc++.h>
#define lli long long
using namespace std;
int n;
long long mek()
{
    return 0;
}
lli erku()
{
    if(p[1] == 1) return 0;
    return 2;
}
lli ereq()
{
    if(p[2] == 2) return erku();
    return 4;
}
lli chors()
{
    if(p[3] == 3) return ereq();
    if(p[0] > 1 && p[1] > 1) return 8;
    return 6;
}
long long minimum_walk(vector<int> p, int s) {
	n = p.size();
	if(n == 1) return mek();
	if(n == 2) return erku();
	if(n == 3) return ereq();
	return chors();
}

Compilation message

books.cpp: In function 'long long int erku()':
books.cpp:12:8: error: 'p' was not declared in this scope
   12 |     if(p[1] == 1) return 0;
      |        ^
books.cpp: In function 'long long int ereq()':
books.cpp:17:8: error: 'p' was not declared in this scope
   17 |     if(p[2] == 2) return erku();
      |        ^
books.cpp: In function 'long long int chors()':
books.cpp:22:8: error: 'p' was not declared in this scope
   22 |     if(p[3] == 3) return ereq();
      |        ^
books.cpp:23:8: error: 'p' was not declared in this scope
   23 |     if(p[0] > 1 && p[1] > 1) return 8;
      |        ^