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<iostream>
#include<cmath>
using namespace std;
using ll = long long;
using ld = long double;
#define forn(i, n) for(int i=0; i<(int)n; ++i)
const int MAXN = 1010, MOD = 1000000007;
int n, arr[MAXN], brr[MAXN];
int calc(){
int prod=1, mx=0;
forn(i, n) prod*=arr[i], mx=max(mx, prod*brr[i]);
return mx;
}
int init(int N, int X[], int Y[]) {
n=N;
forn(i, n) arr[i]=X[i], brr[i]=Y[i];
return calc();
}
int updateX(int pos, int val) {
arr[pos]=val;
return calc();
}
int updateY(int pos, int val) {
brr[pos]=val;
return calc();
}
# | 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... |