# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
428278 | haxorman | Horses (IOI15_horses) | C++14 | 1580 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 "horses.h"
#include "bits/stdc++.h"
using namespace std;
const int mxN = 5e5 + 7;
const int MOD = 1e9 + 7;
int n;
long long x[mxN], y[mxN];
int init(int N, int X[], int Y[]) {
n = N;
for (int i = 0; i < n; ++i) {
x[i] = X[i];
y[i] = Y[i];
}
long long horses = 1, ans = 0;
for (int i = 0; i < n; ++i) {
horses *= x[i];
ans = max(ans, y[i] * horses);
ans %= MOD;
}
return ans;
}
int updateX(int pos, int val) {
x[pos] = val;
long long horses = 1, ans = 0;
for (int i = 0; i < n; ++i) {
horses *= x[i];
ans = max(ans, y[i] * horses);
ans %= MOD;
}
return ans;
}
int updateY(int pos, int val) {
y[pos] = val;
long long horses = 1, ans = 0;
for (int i = 0; i < n; ++i) {
horses *= x[i];
ans = max(ans, y[i] * horses);
ans %= MOD;
}
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... |