Submission #1042189

# Submission time Handle Problem Language Result Execution time Memory
1042189 2024-08-02T15:51:53 Z raphaelp Ancient Books (IOI17_books) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
int64 minimum_walk(int[] p, int S)
{
int N=p.size();
int64 ans=0;
for (int i=0; i<N; i++)
{
ans+=abs(i-p[i]);
}
vector<int>occ(N);
for(int i=0; i<N; i++)
{
if(occ[i])continue;
int x=i;
ans+=2;
while(!occ[x])
{
occ[x]=1;
x=p[x];
}
return ans-2;
}

Compilation message

books.cpp:3:1: error: 'int64' does not name a type; did you mean 'int64_t'?
    3 | int64 minimum_walk(int[] p, int S)
      | ^~~~~
      | int64_t