# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
97885 | someone_aa | Horses (IOI15_horses) | C++17 | 23 ms | 11392 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>
#define ll long long
using namespace std;
const int maxn = 100100;
const ll mod = 1e9 + 7;
ll x[maxn], y[maxn], n;
int solve() {
ll h = 1LL;
ll result = 0LL;
for(int i=0;i<n;i++) {
h *= 1LL * x[i];
h %= mod;
ll temp = (h * 1LL * y[i]) % mod;
result = max(result, temp);
}
return result;
}
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];
}
return solve();
}
int updateX(int pos, int val) {
x[pos] = val;
return solve();
}
int updateY(int pos, int val) {
y[pos] = val;
return solve();
}
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... |