Submission #581434

#TimeUsernameProblemLanguageResultExecution timeMemory
581434jasminRail (IOI14_rail)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include<rail.h> using namespace std; const int inf=1e9; void findLocation(int n, int first, int[] location, int[] stype){ location[0]=first; stype[0]=1; if(n==1) return; vector<int> d0(n); int b=-1; int mini=inf; for(int i=1; i<n; i++){ d0[i]=getDistance(0, i); if(d0[i]<mini){ b=i; mini=d0[i]; } } location[b]=first+mini; for(int i=1; i<n; i++){ if(i==b) continue; int db=getDistance(b, i); if(d0[i]<db){ location[i]=first+d0[i]; stype[i]=2; } else{ location[i]=first+d0[b]-db; stype[i]=1; } } } /*signed main(){ ios_base::sync_with_stdio(false); cin.tie(0); int n; cin >> n; }*/

Compilation message (stderr)

rail.cpp:7:43: error: expected ',' or '...' before 'location'
    7 | void findLocation(int n, int first, int[] location, int[] stype){
      |                                           ^~~~~~~~
rail.cpp: In function 'void findLocation(int, int, int*)':
rail.cpp:8:5: error: 'location' was not declared in this scope; did you mean 'localtime'?
    8 |     location[0]=first;
      |     ^~~~~~~~
      |     localtime
rail.cpp:9:5: error: 'stype' was not declared in this scope; did you mean 'wctype'?
    9 |     stype[0]=1;
      |     ^~~~~
      |     wctype