# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1041243 | SoulKnight | Self Study (JOI22_ho_t2) | C++17 | 154 ms | 11600 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;
#define ll long long
#define ln '\n'
const int N = 3e5 + 5;
const ll INF = 1e18 + 5;
ll n, m, a[N], b[N];
inline ll ceil(ll x, ll y) {
return (x + y - 1) / y;
}
ll cnt(ll go_lesson, ll i, ll tar){
return (m - go_lesson) - max(0LL, ceil(tar - a[i] * go_lesson, b[i]));
}
void solve(){
cin >> n >> m;
for (int i = 0; i < n; i++) cin >> a[i];
for (int i = 0; i < n; i++) cin >> b[i];
// ll l = 7, r = 7, ans = 0;
ll l = 1, r = INF, ans = 1;
while (l <= r){
ll tar = (l + r) / 2;
uint64_t free, need; free = need = 0;
for (int i = 0; i < n; i++){
ll go_lesson = (cnt(1, i, tar) > cnt(0, i, tar)? 1: 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... |