# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
754898 | APROHACK | Horses (IOI15_horses) | C++14 | 1550 ms | 12260 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 <bits/stdc++.h>
#include "horses.h"
#define ll long long
#define pb push_back
const int mod = 1e9+7;
using namespace std;
int n;
ll acum[500005];
ll maxV = 0;
vector<int>x, y;
void updateRet(){
acum[0] = x[0];
maxV = y[0] * acum[0] % mod;
for(int i = 1 ; i < n ; i ++){
acum[i] = acum[i-1] * x[i] % mod;
maxV = max(maxV, y[i] * acum[i] % mod);
}
}
int init(int N, int X[], int Y[]) {
n = N;
for(int i = 0 ; i < N ; i++){
x.pb(X[i]);
y.pb(Y[i]);
}
updateRet();
return maxV%mod;
}
int updateX(int pos, int val) {
x[pos] = val;
updateRet();
return maxV%mod;
}
int updateY(int pos, int val) {
y[pos] = val;
updateRet();
return maxV%mod;
}
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... |