Submission #234179

#TimeUsernameProblemLanguageResultExecution timeMemory
234179pere_gilHorses (IOI15_horses)C++14
Compilation error
0 ms0 KiB
#include <iostream> #include "horses.h" using namespace std; init(int N, int X, int Y) { int big=0; int ja[N]; ja[0]=X[0]; for(int i=1;i<N;i++){ ja[i]=ja[i-1]*X[i]; } for(int i=0;i<N;i++) big=max(big, ja[i]*Y[i]); return big; }

Compilation message (stderr)

horses.cpp:6:25: error: ISO C++ forbids declaration of 'init' with no type [-fpermissive]
 init(int N, int X, int Y)
                         ^
horses.cpp: In function 'int init(int, int, int)':
horses.cpp:10:14: error: invalid types 'int[int]' for array subscript
     ja[0]=X[0];
              ^
horses.cpp:12:26: error: invalid types 'int[int]' for array subscript
         ja[i]=ja[i-1]*X[i];
                          ^
horses.cpp:14:48: error: invalid types 'int[int]' for array subscript
     for(int i=0;i<N;i++) big=max(big, ja[i]*Y[i]);
                                                ^