#include <bits/stdc++.h>
#include "horses.h"
using namespace std;
const int mod = 1e9 + 7;
int nn;
vector <int> a(1005), b(1005);
int init(int n, int x[], int y[]) {
nn = n;
int ans = 1, h = 1;
for (int i = 0; i < n; i++) {
a[i] = x[i];
b[i] = y[i];
h *= x[i];
ans = max(ans, h * y[i]);
}
ans %= mod;
return ans;
}
int updateX(int pos, int val) {
a[pos] = val;
int ans = 1, h = 1;
for (int i = 0; i < nn; i++) {
h *= a[i];
ans = max(ans, h * b[i]);
}
ans %= mod;
return ans;
}
int updateY(int pos, int val) {
b[pos] = val;
int ans = 1, h = 1;
for (int i = 0; i < nn; i++) {
h *= a[i];
ans = max(ans, h * b[i]);
}
ans %= mod;
return ans;
}
# | 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... |