# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
609802 | jairRS | Horses (IOI15_horses) | C++17 | 15 ms | 10492 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 <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAXN = 1000;
const ll MOD = 1e9 + 7;
int gN, gX[MAXN], gY[MAXN];
int getAns(){
ll curAns = gY[gN - 1] * gX[gN - 1];
for (int i = gN - 2; i >= 0; i--)
{
if(gY[i] > curAns)
curAns = gY[i] * gX[i];
else
curAns *= gX[i];
}
return curAns;
}
int init(int N, int X[], int Y[]) {
gN = N;
for (int i = 0; i < N; i++)
{
gX[i] = X[i];
gY[i] = Y[i];
}
return getAns();
}
int updateX(int pos, int val) {
gX[pos] = val;
return getAns();
}
int updateY(int pos, int val) {
gY[pos] = val;
return getAns();
}
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... |