제출 #611818

#제출 시각아이디문제언어결과실행 시간메모리
611818Shithila고대 책들 (IOI17_books)C++14
컴파일 에러
0 ms0 KiB
#include "books.h" long long minimum_walk(std::vector<int> p, int s) { int len=p.size(); int correct=true; int count=0; for(int i=len-1;len>0;len--) { if(p[i]!=i) { correct=false; break; } count++; } if(correct==true) return 0; else { int ans=n-count-1; ans=ans+ans; return ans; } }

컴파일 시 표준 에러 (stderr) 메시지

books.cpp: In function 'long long int minimum_walk(std::vector<int>, int)':
books.cpp:19:11: error: 'n' was not declared in this scope
   19 |   int ans=n-count-1;
      |           ^