Submission #115420

#TimeUsernameProblemLanguageResultExecution timeMemory
115420baqargamAncient Books (IOI17_books)C++14
Compilation error
0 ms0 KiB
#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 (stderr)

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;
           ^