#include "horses.h"
#include <bits/stdc++.h>
using namespace std;
const int MOD=1e9+7, N=5e5+5;
int x[N], y[N],gn;
int calculate(){
int m=0;
for(int i=gn-1; i>=0; i--){
m=max(1ll*m*x[i]%MOD,1ll*x[i]*y[i]%MOD);
}
return m;
}
int init(int n, int X[], int Y[]){
gn=n;
for(int i=0; i<n; i++){
x[i]=X[i];
y[i]=Y[i];
}
return calculate();
}
int updateX(int pos, int val) {
x[pos]=val;
return calculate();
}
int updateY(int pos, int val) {
y[pos]=val;
return calculate();
}
# | 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... |