답안 #786877

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
786877 2023-07-18T14:08:25 Z WLZ Self Study (JOI22_ho_t2) C++17
0 / 100
275 ms 6144 KB
#include <bits/stdc++.h>
using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<int> a(n), b(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  for (int i = 0; i < n; i++) a[i] = max(a[i], b[i]);

  auto check = [&](long long k) {
    vector<long long> left(n, k);
    long long weeks_left = (long long) n * m;
    for (int i = 0; i < n; i++) weeks_left -= (k + a[i] - 1) / a[i];
    return weeks_left >= 0;
  };

  long long lo = 0, hi = (long long) 2e18;
  while (lo < hi) {
    long long mid = (lo + hi + 1) / 2;
    if (check(mid)) lo = mid;
    else hi = mid - 1;
  }
  cout << lo << '\n';
  return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 3 ms 340 KB Output is correct
11 Correct 158 ms 5004 KB Output is correct
12 Correct 155 ms 5008 KB Output is correct
13 Correct 152 ms 5012 KB Output is correct
14 Correct 148 ms 4968 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Incorrect 275 ms 6144 KB Output isn't correct
17 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 275 ms 6144 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 3 ms 340 KB Output is correct
11 Correct 158 ms 5004 KB Output is correct
12 Correct 155 ms 5008 KB Output is correct
13 Correct 152 ms 5012 KB Output is correct
14 Correct 148 ms 4968 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Incorrect 275 ms 6144 KB Output isn't correct
17 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 275 ms 6144 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 3 ms 340 KB Output is correct
11 Correct 158 ms 5004 KB Output is correct
12 Correct 155 ms 5008 KB Output is correct
13 Correct 152 ms 5012 KB Output is correct
14 Correct 148 ms 4968 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Incorrect 275 ms 6144 KB Output isn't correct
17 Halted 0 ms 0 KB -