# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
132469 | reda | Horses (IOI15_horses) | C++14 | 18 ms | 8412 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std ;
#define MOD 1000000007
# include "horses.h"
int X[1005],Y[1005],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];
long long h=1,ans=0;
for(int i=0;i<n;i++)
{
h*=x[i];
h=h%MOD;
ans=max(((h%MOD)*(y[i]%MOD))%MOD,ans);
}
return ans%MOD;
}
int updateX(int pos, int val)
{
X[pos]=val%MOD;
return init(N,X,Y);
}
int updateY(int pos, int val)
{
Y[pos]=val%MOD;
return init(N,X,Y);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |