Submission #353678

#TimeUsernameProblemLanguageResultExecution timeMemory
353678antontsiorvasHorses (IOI15_horses)C++14
Compilation error
0 ms0 KiB
#include "horses.h" #include <algorithm> int x[500005], y[500005]; int init(int N, int X[], int Y[]) { for(int i=0; i<N; i++){ x[i] = X[i]; y[i] = Y[i]; } int horses=1, ret=0; for(int i=0; i<N; i++){ horses *= x[i]; ret %= 1000000007; horses %= 1000000007; ret = std::max(ret, (horses*y[i])%1000000007); } return ret; } int updateX(int pos, int val) { x[pos] = val; int horses=1, ret=0; for(int i=0; i<N; i++){ horses *= x[i]; ret %= 1000000007; horses %= 1000000007; ret = std::max(ret, (horses*y[i])%1000000007); } return ret; } int updateY(int pos, int val) { y[pos] = val; int horses=1, ret=0; for(int i=0; i<N; i++){ horses *= x[i]; ret %= 1000000007; horses %= 1000000007; ret = std::max(ret, (horses*y[i])%1000000007); } return ret; }

Compilation message (stderr)

horses.cpp: In function 'int updateX(int, int)':
horses.cpp:24:17: error: 'N' was not declared in this scope
   24 |  for(int i=0; i<N; i++){
      |                 ^
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:36:17: error: 'N' was not declared in this scope
   36 |  for(int i=0; i<N; i++){
      |                 ^