| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 703251 | MilosMilutinovic | Self Study (JOI22_ho_t2) | C++14 | 312 ms | 8508 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/**
* author: wxhtzdy
* created: 26.02.2023 19:18:55
**/
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, m;
cin >> n >> m;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
vector<int> b(n);
for (int i = 0; i < n; i++) {
cin >> b[i];
if (a[i] < b[i]) {
a[i] = b[i];
}
}
auto Solve = [&](long long x) {
long long f = 0;
for (int i = 0; i < n; i++) {
if (m * 1LL * a[i] >= x) {
long long take = (x + a[i] - 1) / a[i];
f += m - take;
}
}
for (int i = 0; i < n; i++) {
if (m * 1LL * a[i] < x) {
long long need = (x - m * 1LL * a[i] + b[i] - 1) / b[i];
f -= need;
}
}
return f >= 0;
};
long long low = 0, high = 1e18, ans = 0;
while (low <= high) {
long long mid = low + high >> 1;
if (Solve(mid)) {
ans = mid;
low = mid + 1;
} else {
high = mid - 1;
}
}
cout << ans << '\n';
return 0;
}
컴파일 시 표준 에러 (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... | ||||
