# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1123759 | Neco_arc | Self Study (JOI22_ho_t2) | C++17 | 205 ms | 5136 KiB |
#include <bits/stdc++.h>
#define ll unsigned long long
#define name "Self Study"
#define fi(i, a, b) for(int i = a; i <= b; ++i)
#define fid(i, a, b) for(int i = a; i >= b; --i)
#define maxn (int) (3e5 + 7)
using namespace std;
ll n, k;
ll a[maxn], b[maxn];
ll cc(ll x, ll y) { return (x / y) + (x % y != 0); }
bool check(ll X) {
ll S = 0;
fi(i, 1, n) {
if(X <= k * a[i]) S += cc(X, a[i]);
else S += k + cc(X - k * a[i], b[i]);
if(S > n * k) return 0;
}
return 1;
}
void solve() {
cin >> n >> k;
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... |