# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
941211 | peterandvoi | Self Study (JOI22_ho_t2) | C++17 | 274 ms | 8828 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 <bits/stdc++.h>
using namespace std;
#ifdef ngu
#include "debug.h"
#else
#define debug(...) 42
#endif
const int N = (int) 3e5 + 5;
int n, m;
int a[N], b[N];
bool check(long long mid) {
long long cnt = 0;
for (int i = 1; i <= n; ++i) {
if (a[i] < b[i]) {
cnt += (mid - 1) / b[i] + 1;
} else {
if (1LL * a[i] * m >= mid) {
cnt += (mid - 1) / a[i] + 1;
} else {
cnt += (mid - 1LL * a[i] * m - 1) / b[i] + m + 1;
}
}
}
return cnt <= 1LL * n * m;
}
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... |