| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 552852 | elazarkoren | Horses (IOI15_horses) | C++17 | 1535 ms | 14352 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "horses.h"
#include <bits/stdc++.h>
#define x first
#define y second
#define all(v) v.begin(), v.end()
#define chkmin(a, b) a = min(a, b)
#define chkmax(a, b) a = max(a, b)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vii;
const int MAX_N = 5e5 + 5;
const int mod = 1e9 + 7;
int n;
ll x[MAX_N], y[MAX_N];
int Solve() {
ll ans = 0;
ll cnt = 1;
for (int i = 0; i < n; i++) {
cnt *= x[i];
chkmax(ans, y[i] * cnt);
}
return ans % mod;
}
int init(int N, int X[], int Y[]) {
n = N;
for (int i = 0; i < n; i++) {
x[i] = X[i], y[i] = Y[i];
}
return Solve();
}
int updateX(int pos, int val) {
x[pos] = val;
return Solve();
}
int updateY(int pos, int val) {
y[pos] = val;
return Solve();
}
Compilation message (stderr)
| # | 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... | ||||
