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