Submission #251579

#TimeUsernameProblemLanguageResultExecution timeMemory
251579DavidDamianHorses (IOI15_horses)C++11
Compilation error
0 ms0 KiB
#include "horses.h" #include<bits/stdc++.h> using namespace std; #define mod 100000007 typedef long long ll; int x[100005]; int y[100005]; int n; int init(int N, int X[], int Y[]) { n=N; for(int i=0;i<n;i++){ x[i]=X[i]; y[i]=Y[i]; } ll maximum=0; ll product=1; for(int i=0;i<n;i++){ product*=X[i]; maximum=max(maximum,Y[i]*product); } return maximum; } int updateX(int pos, int val) { x[pos]=val; ll maximum=0; ll product=1; for(int i=0;i<n;i++){ product*=X[i]; maximum=max(maximum,Y[i]*product); } return maximum; } int updateY(int pos, int val) { y[pos]=val; ll maximum=0; ll product=1; for(int i=0;i<n;i++){ product*=X[i]; maximum=max(maximum,Y[i]*product); } return maximum; }

Compilation message (stderr)

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:21:9: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
  return maximum;
         ^~~~~~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:29:18: error: 'X' was not declared in this scope
         product*=X[i];
                  ^
horses.cpp:30:29: error: 'Y' was not declared in this scope
         maximum=max(maximum,Y[i]*product);
                             ^
horses.cpp:32:9: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
  return maximum;
         ^~~~~~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:40:18: error: 'X' was not declared in this scope
         product*=X[i];
                  ^
horses.cpp:41:29: error: 'Y' was not declared in this scope
         maximum=max(maximum,Y[i]*product);
                             ^
horses.cpp:43:9: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
  return maximum;
         ^~~~~~~