| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 526349 | model_code | Self Study (JOI22_ho_t2) | C++17 | 225 ms | 5128 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
ll N, M;
cin >> N >> M;
vector<ll> A(N), B(N);
for(ll& a : A) cin >> a;
for(ll& b : B) cin >> b;
for(ll i = 0; i < N; i++) A[i] = max(A[i], B[i]);
ll ok = 0, ng = 1LL << 60;
auto check = [&](ll x) -> bool {
ll day = 0;
for(ll i = 0; i < N; i++){
if(x <= A[i] * M) day += (x + A[i] - 1) / A[i];
else day += M + (x - A[i] * M + B[i] - 1) / B[i];
if(day > N * M) return 0;
}
return 1;
};
while(ng - ok > 1){
const ll mid = (ng + ok) / 2;
if(check(mid)) ok = mid;
else ng = mid;
}
cout << ok << endl;
}| # | 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... | ||||
