제출 #115420

#제출 시각아이디문제언어결과실행 시간메모리
115420baqargam고대 책들 (IOI17_books)C++14
컴파일 에러
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;
}

컴파일 시 표준 에러 (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;
           ^