개발자(진) 옞

  • 홈
  • 태그
  • 방명록

이진탐색 3

[백준][Python] 6236 용돈 관리

🤑https://www.acmicpc.net/problem/6236 내 풀이N, M = map(int, input().split())money = [int(input()) for _ in range(N)]s, e = max(money), sum(money)ans = 0while s mid: result = 0 total += 1 result += m if result > 0: total += 1 if total > M: s = mid + 1 else: e = mid - 1 ans = midprint(ans)  코드 설명s, e = max(money), sum(money)s: 인출할 금..

코딩테스트 2024.07.06

[백준][Python] 2343 기타 레슨

🎸https://www.acmicpc.net/problem/2343  내 풀이N, M = map(int, input().split())guitar = list(map(int, input().split()))s, e = max(guitar), sum(guitar)ans = 0while s mid: total += 1 current = 0 current += g if current > 0: total += 1 if total > M: # 강의 길이를 늘려야 함 s = mid + 1 else: e = mid - 1 ans = midprint(ans)  코드 설명s, e = max(guita..

코딩테스트 2024.07.05

[백준][Python] 2805 나무 자르기

🌳 https://www.acmicpc.net/problem/2805  내 풀이def cutter(): s = 0 e = max(trees) height = 0 while s mid: total += i - mid if total >= M: s = mid + 1 height = mid else: e = mid - 1 return heightN, M = map(int, input().split())trees = list(map(int, input().split()))print(cutter())  코드 설명 이진 탐색(이분 탐색) 문제였다. ✔️ cutter 함수 내s..

코딩테스트 2024.06.29
이전
1
다음
더보기
프로필사진

개발자(진) 옞

새싹 🌱

  • 분류 전체보기 (70)
    • 코딩테스트 (60)
    • Kotlin (2)
      • 냉장고 앱 (2)
    • Web (4)
    • 트러블슈팅 ☄️ (3)
    • 우테코 (1)

Tag

python, 구현, 브루트포스, 알고리즘, 카카오테크부트캠프, 정렬, 백트래킹, 이분탐색, ktb, 그리디, 이진탐색, 트러블슈팅, 그래프, 자료구조, 백준, 파이썬, 투포인터, dfs, BFS, 문자열,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바