Submission #251580

#TimeUsernameProblemLanguageResultExecution timeMemory
251580DavidDamianHorses (IOI15_horses)C++11
17 / 100
16 ms9984 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: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:43:9: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
  return maximum;
         ^~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...