# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
631941 | Stavab | Horses (IOI15_horses) | C++14 | 1576 ms | 18364 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 "horses.h"
#include <vector>
using namespace std;
vector<long long> mult, y, x;
int ans()
{
long long maxVal = 0;
for(int i = 0; i < mult.size(); i++)
{
maxVal = max(maxVal, mult[i]*y[i] % 1000000007);
}
return (int)maxVal;
}
int init(int N, int X[], int Y[])
{
mult.assign(N, 0);
mult[0] = X[0];
x.assign(N, 0);
x[0] = X[0];
y.assign(N, 0);
y[0] = Y[0];
for(int i = 1; i < N; i++)
{
mult[i] = (mult[i - 1] * X[i]) % 1000000007;
y[i] = Y[i];
x[i] = X[i];
}
return ans();
}
int updateX(int pos, int val)
{
x[pos] = val;
for(int i = pos; i < mult.size(); i++)
mult[i] = mult[i - 1] * x[i];
return ans();
}
int updateY(int pos, int val)
{
y[pos] = val;
return ans();
}
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... |