# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
65618 | daniel_02 | Horses (IOI15_horses) | C++17 | 1563 ms | 8476 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 ll long long
using namespace std;
const int MOD = 1e9 + 7;
const int sz = 5e5 + 7;
int n, x[sz], y[sz];
int init(int N, int X[], int Y[]) {
long double h = 0;
ll cur = 1;
long double ans = 0;
ll ans1;
n = N;
for (int i = 0; i < N; i++)
{
x[i] = X[i];
y[i] = Y[i];
h += log10(x[i]);
cur = (cur * x[i]) % MOD;
if (ans * 1.0 < h + log10(y[i]))
{
ans = log10(y[i]) + h;
ans1 = (y[i] * 1LL * cur) % MOD;
}
}
return (ans1 % MOD);
}
int updateX(int pos, int val) {
x[pos] = val;
return init(n, x, y);
}
int updateY(int pos, int val) {
y[pos] = val;
return init(n, x, y);
}
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... |