// 0 indexed btw
#include "horses.h"
#include <bits/stdc++.h>
using namespace std;
#define lint long long
#define arr array
const int N = 5e5 + 5;
const lint MD = 1e9 + 7;
int n;
arr<lint, N> grw, prc;
lint md(lint x) { return (x + MD) % MD; }
int init(int _n, int _grw[], int _prc[]) {
n = _n;
for (int i = 1; i <= n; i++) grw[i] = _grw[i - 1], prc[i] = _prc[i - 1];
lint cr = 1, ans = 0;
for (int i = 1; i <= n; i++) {
cr = cr * grw[i];
ans = max(ans, cr * prc[i]);
}
ans = md(ans);
return ans;
}
int updateX(int pos, int val) {
return 0;
}
int updateY(int pos, int val) {
return 0;
}
# | 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... |