이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e4;
int sz;
int a[N], b[N];
const ll mod = 1e9 + 7;
int init(int n, int* X, int* Y) {
for (int i = 0; i < n; i++) {
a[i] = X[i];
b[i] = Y[i];
}
sz = n;
ll ans = 0;
ll cr = 1;
for (int i = 0; i < n; i++) {
cr = (cr * 1LL * a[i]) % mod;
ans = max(ans, (cr * b[i] * 1LL) % mod);
}
return (int)ans;
}
int updateX(int pos, int val) {
a[pos] = val;
ll ans = 0;
ll cr = 1;
for (int i = 0; i < sz; i++) {
cr = (cr * 1LL * a[i]) % mod;
ans = max(ans, (cr * b[i] * 1LL) % mod);
}
return (int)ans;
}
int updateY(int pos, int val) {
b[pos] = val;
ll ans = 0;
ll cr = 1;
for (int i = 0; i < sz; i++) {
cr = (cr * 1LL * a[i]) % mod;
ans = max(ans, (cr * b[i] * 1LL) % mod);
}
return (int)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... |