본문 바로가기

나의 개발일지

검색하기
나의 개발일지
프로필사진 YoonJuHan

  • 분류 전체보기 (231)
    • 인공지능 (1)
    • Kaggle (4)
    • 프로그래머스 (108)
    • 백준 (82)
    • Oracle SQL (25)
    • Oracle SQL 엔진 (7)
    • 네이버 뉴스 요약 프로젝트 (4)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2026/03   »
일 월 화 수 목 금 토
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
Tags
  • BFS
  • 오라클
  • 이분탐색
  • deque
  • DFS
  • 파이썬
  • KAKAO
  • 데이터베이스
  • heapq
  • heap
  • SQL
  • 다익스트라
  • 코딩테스트
  • 카카오
  • 백준
  • 정렬
  • PCCP
  • 스택
  • 프로그래머스
  • 그리디
  • Database
  • Stack
  • Python
  • DP
  • 힙
  • oracle
  • 너비우선탐색
  • 재귀
  • 딕셔너리
  • 우선순위큐
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록1655 (1)

나의 개발일지

[백준] 1655 가운데를 말해요 [Python, 파이썬]

문제 : https://www.acmicpc.net/problem/1655 🔑 최대 힙과 최소 힙을 함께 사용 import sys from heapq import heappush, heappop input = sys.stdin.readline n = int(input()) num = int(input()) print(num) minHeap, maxHeap = [],[-num] for i in range(n-1): num = int(input()) if num > -maxHeap[0]: heappush(minHeap, num) else: heappush(maxHeap, -num) if len(minHeap) > len(maxHeap): temp = heappop(minHeap) heappush(maxHea..

백준 2023. 11. 3. 11:42
이전 Prev 1 Next 다음

Blog is powered by AXZ / Designed by Tistory

티스토리툴바