Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

입국심사 정답 | codeisneverodd #134

Closed
codeisneverodd opened this issue Mar 22, 2023 · 0 comments
Closed

입국심사 정답 | codeisneverodd #134

codeisneverodd opened this issue Mar 22, 2023 · 0 comments
Assignees
Labels
확인중 👀 제출된 정답을 확인중입니다.

Comments

@codeisneverodd
Copy link
Owner

제출한 정답

function solution(n, times) {
  let [l, r] = [1, 1_000_000_000 * n];

  while (l <= r) {
    const mid = Math.floor((l + r) / 2);
    const possibleN = times.reduce((a, time) => a + Math.floor(mid / time), 0);
    if (possibleN < n) {
      l = mid + 1;
    } else {
      r = mid - 1;
    }
  }
  return l;
}

풀이 데이터

{
  "probId": "43238",
  "author": "codeisneverodd",
  "lang": "JavaScript",
  "createdAt": 1679461931240
}
@codeisneverodd codeisneverodd added the 확인중 👀 제출된 정답을 확인중입니다. label Mar 22, 2023
@codeisneverodd codeisneverodd self-assigned this Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
확인중 👀 제출된 정답을 확인중입니다.
Projects
None yet
Development

No branches or pull requests

1 participant