답안 #786881

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
786881 2023-07-18T14:11:25 Z WLZ Self Study (JOI22_ho_t2) C++17
10 / 100
50 ms 9052 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]);
  cout << *min_element(a.begin(), a.end()) << '\n';
  return 0;

  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 224 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 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 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 1 ms 340 KB Output is correct
11 Correct 45 ms 2644 KB Output is correct
12 Correct 48 ms 2660 KB Output is correct
13 Correct 35 ms 2644 KB Output is correct
14 Correct 35 ms 2680 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 24 ms 2676 KB Output is correct
17 Correct 50 ms 9052 KB Output is correct
18 Correct 46 ms 8408 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 24 ms 2676 KB Output is correct
3 Correct 50 ms 9052 KB Output is correct
4 Correct 46 ms 8408 KB Output is correct
5 Incorrect 0 ms 212 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 224 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 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 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 1 ms 340 KB Output is correct
11 Correct 45 ms 2644 KB Output is correct
12 Correct 48 ms 2660 KB Output is correct
13 Correct 35 ms 2644 KB Output is correct
14 Correct 35 ms 2680 KB Output is correct
15 Incorrect 0 ms 212 KB Output isn't correct
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 224 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 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 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 1 ms 340 KB Output is correct
11 Correct 45 ms 2644 KB Output is correct
12 Correct 48 ms 2660 KB Output is correct
13 Correct 35 ms 2644 KB Output is correct
14 Correct 35 ms 2680 KB Output is correct
15 Incorrect 0 ms 212 KB Output isn't correct
16 Halted 0 ms 0 KB -