# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
420114 | Aldas25 | Horses (IOI15_horses) | C++14 | 1582 ms | 14096 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 FAST_IO ios_base::sync_with_stdio(0); cin.tie(nullptr)
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define REP(n) FOR(O, 1, (n))
#define f first
#define s second
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vii;
typedef vector<ll> vl;
const int MAXN = 500100;
const ll MOD = 1e9+7;
int n;
ll x[MAXN], y[MAXN];
ll getMax () {
ll ret = 0;
ll cur = 1;
FOR(i, 0, n-1) {
cur *= x[i];
ret = max(ret, cur * y[i]);
}
return ret;
}
int init(int N, int X[], int Y[]) {
n = N;
FOR(i, 0, n-1) x[i] = X[i];
FOR(i, 0, n-1) y[i] = Y[i];
return getMax();
}
int updateX(int pos, int val) {
x[pos] = val;
return getMax();
}
int updateY(int pos, int val) {
y[pos] = val;
return getMax();
}
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... |