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 <algorithm>
int n, x[500005], y[500005];
int init(int N, int X[], int Y[]) {
for(int i=0; i<N; i++){
x[i] = X[i];
y[i] = Y[i];
}
n = N;
int horses=1, ret=0;
for(int i=0; i<N; i++){
horses *= x[i];
ret %= 1000000007;
horses %= 1000000007;
ret = std::max(ret, (horses*y[i])%1000000007);
}
return ret;
}
int updateX(int pos, int val) {
x[pos] = val;
int horses=1, ret=0;
for(int i=0; i<n; i++){
horses *= x[i];
ret %= 1000000007;
horses %= 1000000007;
ret = std::max(ret, (horses*y[i])%1000000007);
}
return ret;
}
int updateY(int pos, int val) {
y[pos] = val;
int horses=1, ret=0;
for(int i=0; i<n; i++){
horses *= x[i];
ret %= 1000000007;
horses %= 1000000007;
ret = std::max(ret, (horses*y[i])%1000000007);
}
return ret;
}
# | 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... |