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