Submission #920927

#TimeUsernameProblemLanguageResultExecution timeMemory
920927salmonAncient Books (IOI17_books)C++14
Compilation error
0 ms0 KiB
#include "books.h" long long minimum_walk(std::vector<int> p, int s) { long long sum = 0; for(int i = 0; i < N; i++){ sum += abs(p[i] - i); } return sum + 2; }

Compilation message (stderr)

books.cpp: In function 'long long int minimum_walk(std::vector<int>, int)':
books.cpp:6:24: error: 'N' was not declared in this scope
    6 |     for(int i = 0; i < N; i++){
      |                        ^
books.cpp:7:16: error: 'abs' was not declared in this scope
    7 |         sum += abs(p[i] - i);
      |                ^~~