Submission #353863

#TimeUsernameProblemLanguageResultExecution timeMemory
353863antontsiorvasHorses (IOI15_horses)C++14
Compilation error
0 ms0 KiB
#include "horses.h" #include <algorithm> long long 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]; } long long int horses=1; long long int ret=0; for(int i=0; i<N; i++){ horses *= x[i]; ret %= 1000000007; horses %= 1000000007; ret = std::max(ret, (horses*y[i])%1000000007); } int ret2 = ret; return ret2; } int updateX(int pos, int val) { x[pos] = val; long long int horses=1; long long int ret=0; for(int i=0; i<N; i++){ horses *= x[i]; ret %= 1000000007; horses %= 1000000007; ret = std::max(ret, (horses*y[i])%1000000007); } int ret2 = ret; return ret2; } int updateY(int pos, int val) { y[pos] = val; long long int horses=1; long long int ret=0; for(int i=0; i<N; i++){ horses *= x[i]; ret %= 1000000007; horses %= 1000000007; ret = std::max(ret, (horses*y[i])%1000000007); } int ret2 = ret; return ret2; }

Compilation message (stderr)

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:19:13: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   19 |  int ret2 = ret;
      |             ^~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:27:17: error: 'N' was not declared in this scope
   27 |  for(int i=0; i<N; i++){
      |                 ^
horses.cpp:33:13: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   33 |  int ret2 = ret;
      |             ^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:41:17: error: 'N' was not declared in this scope
   41 |  for(int i=0; i<N; i++){
      |                 ^
horses.cpp:47:13: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   47 |  int ret2 = ret;
      |             ^~~