# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
612376 | boris_mihov | Self Study (JOI22_ho_t2) | C++14 | 305 ms | 5004 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 <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
typedef long long llong;
const int MAXN = 300000 + 10;
const llong INF = 1e18;
llong n, m;
llong a[MAXN], b[MAXN];
llong achieved[MAXN];
bool check(llong value)
{
llong freeB = 0;
for (int i = 1 ; i <= n ; ++i)
{
if (b[i] >= a[i])
{
llong currLections = (value / b[i] + ((value % b[i]) > 0));
freeB += m - currLections;
} else
{
llong currLections = std::min(m, (value / a[i] + ((value % a[i]) > 0)));
if (value <= m * a[i]) freeB += m - currLections;
else
{
llong moreLections = (value - m * a[i]) / b[i] + (((value - m * a[i]) % b[i]) > 0);
freeB -= moreLections;
# | 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... |