# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
810984 | tkwiatkowski | Self Study (JOI22_ho_t2) | C++17 | 427 ms | 8416 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
using namespace std;
bool check(long long min_lvl, int m, vector<int> &A, vector<int> &B) {
long long cnt = 0;
int n = A.size();
for (int i = 0; i < n; ++i) {
int a = max(A[i], B[i]);
int b = B[i];
long long curr_cnt = min((long long)m, (min_lvl + a - 1) / a);
cnt += curr_cnt + max((long long)0, (min_lvl - curr_cnt * a + b - 1) / b);
}
return cnt <= (long long)n * m;
}
long long BS(int m, vector<int> &A, vector<int> &B) {
long long lo = 0, hi = 1e18;
while (lo < hi) {
long long mid = (lo + hi + 1) / 2;
if (check(mid, m, A, B))
lo = mid;
else
hi = mid - 1;
}
return lo;
}
int main() {
ios_base::sync_with_stdio(0);
# | 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... |