# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
758562 | 2023-06-14T22:27:31 Z | Charizard2021 | Self Study (JOI22_ho_t2) | C++17 | 1 ms | 340 KB |
#include<bits/stdc++.h> using namespace std; bool works(long long mid, vector<long long>& a, vector<long long>& b, long long n, long long m){ long long days = 0; for(long long i = 0; i < n; i++){ if(mid <= a[i] * m){ days += (mid + a[i] - 1) / a[i]; } else{ days += m + (mid - a[i] * m + b[i] - 1) / b[i]; } if(days > n * m){ return 0; } } } int main(){ long long n, m; cin >> n >> m; vector<long long> a(n); for(long long i = 0; i < n; i++){ cin >> a[i]; } vector<long long> b(n); for(long long i = 0; i < n; i++){ cin >> b[i]; } for(long long i = 0; i < n; i++){ a[i] = max(a[i], b[i]); } long long low = 0; long long high = 1e18; while(low < high){ long long mid = (low + high)/2; if(works(mid, a, b, n, m)){ low = mid; } else{ high = mid; } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 340 KB | Execution killed with signal 8 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 340 KB | Execution killed with signal 8 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 340 KB | Execution killed with signal 8 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 340 KB | Execution killed with signal 8 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 340 KB | Execution killed with signal 8 |
2 | Halted | 0 ms | 0 KB | - |