Submission #115420

# Submission time Handle Problem Language Result Execution time Memory
115420 2019-06-07T11:25:14 Z baqargam Ancient Books (IOI17_books) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include "books.h"

using namespace std;

long long minimum_walk(std::vector<int> p, int s) {
    int n=p.size();
    for(int i=n-1;i>=0;i--){
        if(p[i]!=i) break;
    }
	return 2*i;
}

Compilation message

books.cpp: In function 'long long int minimum_walk(std::vector<int>, int)':
books.cpp:11:11: error: 'i' was not declared in this scope
  return 2*i;
           ^