이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#ifdef NYAOWO
#include "grader.cpp"
#endif
#include "horses.h"
#include <bits/stdc++.h>
#define For(i, a, b) for(int i = a; i <= b; i++)
#define Forr(i, a, b) for(int i = a; i >= b; i--)
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define sz(x) ((int)x.size())
#define eb emplace_back
#define int LL
#define MOD (int)(1'000'000'007)
using namespace std;
using LL = long long;
using pii = pair<int, int>;
const int MAXN = 500'000;
int n;
int x[MAXN + 10];
int y[MAXN + 10];
int32_t solve() {
int mx = 0;
int cur = 1;
For(i, 0, n - 1) {
cur *= x[i];
mx = max(mx, cur * y[i]);
}
return (int32_t)(mx % MOD);
}
int32_t init(int32_t N, int32_t X[], int32_t Y[]) {
n = N;
For(i, 0, n - 1) x[i] = X[i];
For(i, 0, n - 1) y[i] = Y[i];
return solve();
}
int32_t updateX(int32_t pos, int32_t val) {
x[pos] = val;
return solve();
}
int32_t updateY(int32_t pos, int32_t val) {
y[pos] = val;
return solve();
}
# | 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... |