This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#pragma GCC optimize("O3")
#include "horses.h"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int MOD = (int)(1e9)+7;
int x[500005],y[500005],n;
ll solve(){
ll nb=1,ans=0;
for (int i = 0; i < n; ++i)
{
nb=((nb%MOD)*(x[i]%MOD))%MOD;
ans=max(ans,((nb%MOD)*(y[i]%MOD))%MOD);
}
return ans%MOD;
}
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 (int)solve();
}
int updateX(int pos, int val) {
x[pos]=val;
return (int)solve();
}
int updateY(int pos, int val) {
y[pos]=val;
return (int)solve();
}
| # | 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... |