# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
439095 | MilosMilutinovic | Horses (IOI15_horses) | C++14 | 1592 ms | 12036 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>
#define MAXN 500007
#define mod 1000000007
using namespace std;
int n;
long long x[MAXN],y[MAXN];
int brute()
{
long long p=1LL,ans=0;
for(int i=0;i<n;i++)
{
p*=x[i];
p%=mod;
ans=max(ans,p*y[i]);
}
return ans%mod;
}
int init(int N, int X[], int Y[])
{
n=N;
for(int i=0;i<N;i++)x[i]=X[i];
for(int i=0;i<N;i++)y[i]=Y[i];
return brute();
}
int updateX(int pos, int val)
{
x[pos]=val;
return brute();
}
int updateY(int pos, int val)
{
y[pos]=val;
return brute();
}
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... |