| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1030874 | VMaksimoski008 | Self Study (JOI22_ho_t2) | C++17 | 232 ms | 10864 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll n, m;
cin >> n >> m;
vector<ll> a(n+1), b(n+1);
for(int i=1; i<=n; i++) cin >> a[i];
for(int i=1; i<=n; i++) cin >> b[i];
for(int i=1; i<=n; i++) a[i] = max(a[i], b[i]);
__int128_t l=1, r=1e18, ans=0;
while(l <= r) {
__int128_t mid = (l + r) / 2;
ll total = 0;
for(int i=1; i<=n; i++) {
if(a[i] * m >= mid) total += (mid + a[i] - 1) / a[i];
else total += (mid - a[i] * m + b[i] - 1) / b[i] + m;
}
if(total <= n * m) ans = mid, l = mid + 1;
else r = mid - 1;
}
cout << (ll)ans << '\n';
return 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... | ||||
