Submission #235938

#TimeUsernameProblemLanguageResultExecution timeMemory
235938MickyAngelHorses (IOI15_horses)C++14
Compilation error
0 ms0 KiB
#include  "horses.h"
#include  <algorithm>

using  namespace  std; 

int init(int N,int X[],int Y[]){
 int V[N];
 V[0] = X[0];
 for (int i-1; i<N; i++) V[i] = V[i-1] * X[i];
  
 int  mx  =  0;
 for(int  i=0;  i<N;  i++)  { 
   mx  =  max  (mx,  V[i]  Y[i]);
 }
  
 return  mx;

int  updateX(int  pos,  int  val)  { 
  return  0;
} 

 int  updateY(int  pos,  int  val)  {
   return  0;
 }

Compilation message (stderr)

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:9:12: error: expected ';' before '-' token
  for (int i-1; i<N; i++) V[i] = V[i-1] * X[i];
            ^
horses.cpp:9:17: warning: for increment expression has no effect [-Wunused-value]
  for (int i-1; i<N; i++) V[i] = V[i-1] * X[i];
                ~^~
horses.cpp:9:19: error: expected ')' before ';' token
  for (int i-1; i<N; i++) V[i] = V[i-1] * X[i];
                   ^
horses.cpp:9:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
  for (int i-1; i<N; i++) V[i] = V[i-1] * X[i];
  ^~~
horses.cpp:9:21: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
  for (int i-1; i<N; i++) V[i] = V[i-1] * X[i];
                     ^
horses.cpp:9:21: error: 'i' was not declared in this scope
horses.cpp:12:11: warning: declaration of 'i' shadows a previous local [-Wshadow]
  for(int  i=0;  i<N;  i++)  { 
           ^
horses.cpp:9:21: note: shadowed declaration is here
  for (int i-1; i<N; i++) V[i] = V[i-1] * X[i];
                     ^
horses.cpp:13:28: error: expected ')' before 'Y'
    mx  =  max  (mx,  V[i]  Y[i]);
                            ^
horses.cpp:18:36: error: a function-definition is not allowed here before '{' token
 int  updateX(int  pos,  int  val)  { 
                                    ^
horses.cpp:22:37: error: a function-definition is not allowed here before '{' token
  int  updateY(int  pos,  int  val)  {
                                     ^
horses.cpp:24:2: error: expected '}' at end of input
  }
  ^
horses.cpp:6:30: warning: unused parameter 'Y' [-Wunused-parameter]
 int init(int N,int X[],int Y[]){
                              ^