Submission #59956

#TimeUsernameProblemLanguageResultExecution timeMemory
59956theknife2001Dancing Elephants (IOI11_elephants)C++17
Compilation error
0 ms0 KiB
#include "elephants.h" int n; int ind[50005]; int ind1[50005]; int l; void init(int N, int L, int X[]) { for(int i=0;i<N;i++) ind[i]=X[i]; l=L; n=N; } int update(int i, int y) { ind[i]=y; for(int i=0;i<n;i++) ind1[i]=ind[i]; sort(ind1,ind1+n); int cnt=1; int last=ind1[0]; for(int i=1;i<n;i++) { if(last+l<ind1[i]) { cnt++; last=ind1[i]; } } return cnt; }

Compilation message (stderr)

elephants.cpp: In function 'int update(int, int)':
elephants.cpp:21:5: error: 'sort' was not declared in this scope
     sort(ind1,ind1+n);
     ^~~~
elephants.cpp:21:5: note: suggested alternative: 'short'
     sort(ind1,ind1+n);
     ^~~~
     short