| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1042182 | raphaelp | Ancient Books (IOI17_books) | C++14 | Compilation error | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 (stderr)
books.cpp:7:5: error: extended character is not valid in an identifier
7 | { ans+=abs(i-p[i]); } vector<int>occ(N);
| ^
books.cpp:7:8: error: extended character is not valid in an identifier
7 | { ans+=abs(i-p[i]); } vector<int>occ(N);
| ^
books.cpp:7:31: error: extended character is not valid in an identifier
7 | { ans+=abs(i-p[i]); } vector<int>occ(N);
| ^
books.cpp:8:29: error: extended character is not valid in an identifier
8 | for(int i=0; i<N; i++) { if(occ[i])continue;
| ^
books.cpp:8:32: error: extended character is not valid in an identifier
8 | for(int i=0; i<N; i++) { if(occ[i])continue;
| ^
books.cpp:9:2: error: extended character is not valid in an identifier
9 | int x=i;
| ^
books.cpp:9:5: error: extended character is not valid in an identifier
9 | int x=i;
| ^
books.cpp:9:16: error: extended character is not valid in an identifier
9 | int x=i;
| ^
books.cpp:9:19: error: extended character is not valid in an identifier
9 | int x=i;
| ^
books.cpp:10:36: error: extended character is not valid in an identifier
10 | ans+=2; while(!occ[x]) { occ[x]=1; x=p[x]; } return ans-2;}
| ^
books.cpp:10:39: error: extended character is not valid in an identifier
10 | ans+=2; while(!occ[x]) { occ[x]=1; x=p[x]; } return ans-2;}
| ^
books.cpp:10:56: error: extended character is not valid in an identifier
10 | ans+=2; while(!occ[x]) { occ[x]=1; x=p[x]; } return ans-2;}
| ^
books.cpp:10:62: error: extended character is not valid in an identifier
10 | ans+=2; while(!occ[x]) { occ[x]=1; x=p[x]; } return ans-2;}
| ^
books.cpp:10:65: error: extended character is not valid in an identifier
10 | ans+=2; while(!occ[x]) { occ[x]=1; x=p[x]; } return ans-2;}
| ^
books.cpp:10:68: error: extended character is not valid in an identifier
10 | ans+=2; while(!occ[x]) { occ[x]=1; x=p[x]; } return ans-2;}
| ^
books.cpp:10:80: error: extended character is not valid in an identifier
10 | ans+=2; while(!occ[x]) { occ[x]=1; x=p[x]; } return ans-2;}
| ^
books.cpp:10:83: error: extended character is not valid in an identifier
10 | ans+=2; while(!occ[x]) { occ[x]=1; x=p[x]; } return ans-2;}
| ^
books.cpp:10:86: error: extended character is not valid in an identifier
10 | ans+=2; while(!occ[x]) { occ[x]=1; x=p[x]; } return ans-2;}
| ^
books.cpp:10:96: error: extended character is not valid in an identifier
10 | ans+=2; while(!occ[x]) { occ[x]=1; x=p[x]; } return ans-2;}
| ^
books.cpp:10:102: error: extended character is not valid in an identifier
10 | ans+=2; while(!occ[x]) { occ[x]=1; x=p[x]; } return ans-2;}
| ^
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