# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
795284 | Josia | Horses (IOI15_horses) | C++17 | 1556 ms | 12040 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;
#define ll long long
#define int long long
const ll mod = 1e9+7;
int N;
vector<ll> X, Y;
struct getSol {
int sol = 0;
getSol() {
int currProd = 1;
for (int i = 0; i<N; i++) {
currProd *= X[i];
if (currProd * Y[i] > sol) sol = currProd*Y[i];
}
}
};
signed init(signed _N, signed _X[], signed _Y[]) {
N = _N;
X.resize(N);
Y.resize(N);
for (int i = 0; i<N; i++) X[i] = _X[i];
for (int i = 0; i<N; i++) Y[i] = _Y[i];
return getSol().sol;
}
signed updateX(signed pos, signed val) {
X[pos] = val;
return getSol().sol;
}
signed updateY(signed pos, signed val) {
Y[pos] = val;
return getSol().sol;
}
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... |