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

3-kjs254 #10

Merged
merged 2 commits into from
Feb 21, 2024
Merged

3-kjs254 #10

merged 2 commits into from
Feb 21, 2024

Conversation

kjs254
Copy link
Member

@kjs254 kjs254 commented Feb 18, 2024

๐Ÿ”— ๋ฌธ์ œ ๋งํฌ

์•ผ๊ทผ ์ง€์ˆ˜

โœ”๏ธ ์†Œ์š”๋œ ์‹œ๊ฐ„

30๋ถ„

Lv.3 ๋ฌธ์ œ๊ธธ๋ž˜ ์–ด๋ ค์šธ ์ค„ ์•Œ์•˜์ง€๋งŒ heap ๋งŒ ์•Œ๋ฉด Lv.1 ๊ณผ ๋Œ€๋“ฑํ•˜๋‹ค๊ณ  ๋Š๋‚๋‹ˆ๋‹ค.

โœจ ์ˆ˜๋„ ์ฝ”๋“œ

1. ๋ฌธ์ œ ํ•ด์„

์ž…๋ ฅ : n, works

ํ‡ด๊ทผ๊นŒ์ง€ ๋‚จ์€ n ์‹œ๊ฐ„ ์•ˆ์— ์•ผ๊ทผ ํ”ผ๋กœ๋„๋ฅผ ์ตœ์†Œํ™” ํ•˜์—ฌ ์ถœ๋ ฅํ•˜๋Š” ๊ฒƒ์ด ๋ชฉ์ ์ž…๋‹ˆ๋‹ค.

์ž‘์—…๋Ÿ‰ works ๋Š” ์ •์ˆ˜ ๋ฐฐ์—ด [w1,w2,w3,...] ์ด๋ฉฐ ์›์†Œ๋Š” ๊ฐ ์—…๋ฌด๋ฅผ ๋๋‚ด๋Š”๋ฐ ๊ฑธ๋ฆฌ๋Š” ์‹œ๊ฐ„์ž…๋‹ˆ๋‹ค.

์•ผ๊ทผ ํ”ผ๋กœ๋„๋Š” ํ‡ด๊ทผ ํ›„ ๋‚จ์€ ์ž‘์—…๋Ÿ‰์„ ์ œ๊ณฑํ•œ ํ›„ ํ•ฉํ•œ ๊ฐ’ ์ž…๋‹ˆ๋‹ค.

์˜ˆ๋ฅผ ๋“ค์–ด works=[4,3,3,1] ์ด๋ฉฐ n=6 ์ธ ๊ฒฝ์šฐ,

ํ‡ด๊ทผ ํ›„ ์•ผ๊ทผ ํ”ผ๋กœ๋„๊ฐ€ ์ตœ์†Œ๊ฐ€ ๋˜๋Š” ์ž‘์—…๋Ÿ‰ works ๋Š” [2,1,1,1] ์ด๋ฉฐ

์ด ๋•Œ ์•ผ๊ทผ ํ”ผ๋กœ๋„๋Š” 22 + 12 + 12 + 12 = 7 ์ž…๋‹ˆ๋‹ค.

๋งŒ์•ฝ n ์ด works ์˜ ํ•ฉ๋ณด๋‹ค ํฌ๋ฉด ์•ผ๊ทผ ํ•  ์ผ์ด ์—†์œผ๋‹ˆ ์•ผ๊ทผ ํ”ผ๋กœ๋„๋Š” 0์ด ๋ฉ๋‹ˆ๋‹ค ์‹ ๋‚œ๋‹ค!

๊ณ ๋ คํ•  ์ ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

i. ์•ผ๊ทผ ํ”ผ๋กœ๋„ ์ตœ์†Œํ™”

works ์˜ ์ตœ๋Œ€๊ฐ’์—์„œ 1์„ ๋บ๋‹ˆ๋‹ค. ์ด๋ฅผ n ๋ฒˆ ๋ฐ˜๋ณตํ•ฉ๋‹ˆ๋‹ค.

ii. ์‹œ๊ฐ„ ๋ณต์žก๋„

๋ฌธ์ œ์˜ ์ œํ•œ ์‚ฌํ•ญ์ด ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  • works ๋Š” ๊ธธ์ด 1 ์ด์ƒ, 20,000 ์ดํ•˜์ธ ๋ฐฐ์—ด์ž…๋‹ˆ๋‹ค.
  • works ์˜ ์›์†Œ๋Š” 50,000 ์ดํ•˜์ธ ์ž์—ฐ์ˆ˜์ž…๋‹ˆ๋‹ค.
  • n ์€ 1,000,000 ์ดํ•˜์ธ ์ž์—ฐ์ˆ˜์ž…๋‹ˆ๋‹ค.

์œ„ ๋ฌธ์ œ๋ฅผ $O(n)$์„ ๊ฐ€์ง€๋Š”max() ์™€ ๋ฐ˜๋ณต๋ฌธ๋งŒ์œผ๋กœ ๊ตฌํ˜„ํ•˜๋ฉด, ์ตœ์•…์˜ ๊ฒฝ์šฐ 20,000,000,000ํšŒ์˜ ์—ฐ์‚ฐ์ด ์‹คํ–‰๋˜๋ฉฐ ์ด๋Š” ์•„๋ฌด๋ฆฌ ๋นจ๋ผ๋„ 20์ดˆ๊ฐ€ ๊ฑธ๋ฆฝ๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ๋‹ค๋ฅธ ์ž๋ฃŒ๊ตฌ์กฐ๋ฅผ ๊ณ ๋ คํ•ฉ๋‹ˆ๋‹ค.

image

heap ์€ ์œ„์ฒ˜๋Ÿผ ์™„์ „์ด์ง„ํŠธ๋ฆฌ๋กœ ๊ตฌ์„ฑ๋˜๋ฉฐ ์ด์ง„ํƒ์ƒ‰์„ ํ†ตํ•ด ์ตœ๋Œ“๊ฐ’๊ณผ ์ตœ์†Ÿ๊ฐ’์„ ๊ฐ€์ง€๋ฏ€๋กœ $O(log,n)$๋ฅผ ๊ฐ€์ง‘๋‹ˆ๋‹ค.

๋”ฐ๋ผ์„œ ์ตœ๋Œ€๊ฐ’์„ ๊ตฌํ•˜๊ธฐ ์œ„ํ•ด heapq ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ํ†ตํ•ด max heap์„ ๊ตฌํ˜„ํ•ฉ๋‹ˆ๋‹ค.



2. ์ˆ˜๋„ ์ฝ”๋“œ

works = max_heap(works) # ์ตœ๋Œ€ํž™ ์ƒ์„ฑ

for i in range(n):
    max(works) -=1

    if max(works)<=0: # ์ตœ๋Œ€๊ฐ’์ด 0๋ณด๋‹ค ์ž‘๋‹ค => ๋ชจ๋“  ์—…๋ฌด๋ฅผ ๋๋ƒˆ๋‹ค (0์„ ๋ฐ˜ํ™˜)
    retrun 0

return sum(works**2) # ์ œ๊ณฑํ•ฉ์„ ๋ฐ˜ํ™˜



3. ์ฝ”๋“œ ์ž‘์„ฑ

max_heap = []

for w in works:
        heapq.heappush(max_heap, (-w,w))

ํŒŒ์ด์ฌ์˜ heapq ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋Š” max heap์ด ์•„๋‹Œ min heap ์„ ๊ธฐ๋ณธ์ ์œผ๋กœ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.

ํž™์— ์›์†Œ๋ฅผ ์ถ”๊ฐ€ํ•  ๋•Œ tuple ์˜ ๊ฒฝ์šฐ ์ฒซ ๋ฒˆ์งธ ์›์†Œ์— ๋”ฐ๋ผ ํž™์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

๊ทธ๋ž˜์„œ tuple์„ ์ด์šฉํ•ด (-x, x) ๋ฅผ min heap ์— ์‚ฝ์ž…ํ•˜์—ฌ max heap ์ฒ˜๋Ÿผ ์ž‘๋™ํ•˜๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.

์ „์ฒด ์ฝ”๋“œ

import heapq
def solution(n, works):
    max_heap = []
    for w in works:
        heapq.heappush(max_heap, (-w,w))
    
    for i in range(n):
        max_work = heapq.heappop(max_heap)[1]-1
        if max_work<0:
            return 0
        
        heapq.heappush(max_heap,(-max_work,max_work))
        
    print(max_heap)
    answer = sum([x[1]**2 for x in max_heap])
    return answer



๐Ÿ“š ์ƒˆ๋กญ๊ฒŒ ์•Œ๊ฒŒ๋œ ๋‚ด์šฉ

heapq ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ํ†ตํ•ด max heap๊ณผ min heap์„ ๊ตฌํ˜„ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์•Œ์•˜์Šต๋‹ˆ๋‹ค.

์—ญ์‹œ ๊ธ€๋กœ ๋ฐฐ์šฐ๋Š” ๊ฒƒ๋ณด๋‹ค ๋ฌธ์ œ ํ•˜๋‚˜ ํ’€์–ด๋ณด๋Š”๊ฒŒ ํ›จ์”ฌ ์Šต๋“์ด ๋น ๋ฅธ๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค.

์ถœ์ฒ˜ : [Python] ํž™ ์ž๋ฃŒ๊ตฌ์กฐ / ํž™ํ(heapq) / ํŒŒ์ด์ฌ์—์„œ heapq ๋ชจ๋“ˆ ์‚ฌ์šฉํ•˜๊ธฐ

Copy link
Collaborator

@rivkms rivkms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ œ๊ฐ€ ๋ง‰์ƒ ์ฒ˜์Œ ํ‘ผ๋‹ค๊ณ  ํ•˜๋ฉด ๊ณ ๋ฏผ์„ ๋งŽ์ด ํ–ˆ์„ ๊ฒƒ ๊ฐ™์€๋ฐ, ๋น ๋ฅธ ์‹œ๊ฐ„์— ์ข‹์€ ๋ฐฉ๋ฒ•์œผ๋กœ ์ž˜ ํ’€์ดํ•˜์‹  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
ํŠนํžˆ ์ œ๊ฐ€ ์ƒ๊ฐํ•˜์ง€ ๋ชปํ•œ ๋ฐฉ๋ฒ•์œผ๋กœ ํ’€์ด๋ฅผ ํ•ด์ฃผ์…จ์–ด์„œ ๋งŽ์€ ๋„์›€์ด ๋œ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

์ˆ˜๊ณ ํ•˜์…จ์Šต๋‹ˆ๋‹ค ๐Ÿ˜

def solution(n, works):
max_heap = []
for w in works:
heapq.heappush(max_heap, (-w,w))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ฝ”๋“œ์—์„œ ์ด ๋ถ€๋ถ„์ด ์ž˜ ์ดํ•ด๊ฐ€ ๋˜์ง€ ์•Š์•˜์—ˆ์ง€๋งŒ ์„ค๋ช…์„ ์ž˜ ํ•ด์ฃผ์…”์„œ Max Heap์„ ๊ตฌํ˜„ํ•˜๋Š” ๋ฐฉ๋ฒ•์ด๋ผ๋Š” ๊ฒƒ์„ ์ž˜ ์•Œ ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.
์ข‹์€ ์„ค๋ช… ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.๐Ÿ˜

Comment on lines +7 to +12
for i in range(n):
max_work = heapq.heappop(max_heap)[1]-1
if max_work<0:
return 0

heapq.heappush(max_heap,(-max_work,max_work))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ii ์—์„œ ์„ค๋ช…ํ•ด์ฃผ์…จ๋˜ ๊ฒƒ์ฒ˜๋Ÿผ ์‹œ๊ฐ„ ๋ณต์žก๋„์— ๋Œ€ํ•ด ์„ค๋ช…ํ•ด์ฃผ์‹œ๋ฉฐ ์‹œ๊ฐ„๋ณต์žก๋„๊ฐ€ O(n)์ฒ˜๋Ÿผ ๋‚˜์˜ค๋ฉฐ ์‹œ๊ฐ„์ด ์˜ค๋ž˜๊ฑธ๋ ค heap์„ ์ด์šฉํ•˜์—ฌ ์‹œ๊ฐ„์„ ์ค„์ด๊ฒ ๋‹ค๋Š” ์ „๋žต์„ ์ž˜ ์ดํ•ดํ•˜์˜€์Šต๋‹ˆ๋‹ค. ์ข‹์€ ๋ฐฉ๋ฒ•์ธ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

์ €๋Š” ์ฒ˜์Œ์— ๋งค ์‹œํ–‰ ์ „ sort ํ•˜์—ฌ ์ œ์ผ ํฐ ๊ฐ’์„ ์ฐพ์•„ -1 ํ•˜๊ฒ ๋‹ค๊ณ  ์ƒ๊ฐํ•˜์˜€์œผ๋‚˜, ์กฐ๊ธˆ ๊ณ ๋ฏผํ•ด๋ณด๋‹ˆ ์‹œ๊ฐ„๋ณต์žก๋„๊ฐ€ ๋” ๋†’๊ฒŒ ๋‚˜์˜ค๋Š” ๊ฒƒ ๊ฐ™๋„ค์š”. ์ด ๋ถ€๋ถ„์— ๋Œ€ํ•ด์„œ๋„ ์ œ ์ƒ๊ฐ์ด ๋งž๋Š”์ง€ ํ”ผ๋“œ๋ฐฑํ•ด์ฃผ์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

์ œ๊ฐ€ ์ƒ๊ฐํ•ด๋ณด์ง€ ๋ชปํ–ˆ๋˜ ๋ฐฉ๋ฒ•์ธ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ์ข‹์€ ๋ฐฉ๋ฒ• ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.๐Ÿ˜

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ii ์—์„œ ์„ค๋ช…ํ•ด์ฃผ์…จ๋˜ ๊ฒƒ์ฒ˜๋Ÿผ ์‹œ๊ฐ„ ๋ณต์žก๋„์— ๋Œ€ํ•ด ์„ค๋ช…ํ•ด์ฃผ์‹œ๋ฉฐ ์‹œ๊ฐ„๋ณต์žก๋„๊ฐ€ O(n)์ฒ˜๋Ÿผ ๋‚˜์˜ค๋ฉฐ ์‹œ๊ฐ„์ด ์˜ค๋ž˜๊ฑธ๋ ค heap์„ ์ด์šฉํ•˜์—ฌ ์‹œ๊ฐ„์„ ์ค„์ด๊ฒ ๋‹ค๋Š” ์ „๋žต์„ ์ž˜ ์ดํ•ดํ•˜์˜€์Šต๋‹ˆ๋‹ค. ์ข‹์€ ๋ฐฉ๋ฒ•์ธ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

์ €๋Š” ์ฒ˜์Œ์— ๋งค ์‹œํ–‰ ์ „ sort ํ•˜์—ฌ ์ œ์ผ ํฐ ๊ฐ’์„ ์ฐพ์•„ -1 ํ•˜๊ฒ ๋‹ค๊ณ  ์ƒ๊ฐํ•˜์˜€์œผ๋‚˜, ์กฐ๊ธˆ ๊ณ ๋ฏผํ•ด๋ณด๋‹ˆ ์‹œ๊ฐ„๋ณต์žก๋„๊ฐ€ ๋” ๋†’๊ฒŒ ๋‚˜์˜ค๋Š” ๊ฒƒ ๊ฐ™๋„ค์š”. ์ด ๋ถ€๋ถ„์— ๋Œ€ํ•ด์„œ๋„ ์ œ ์ƒ๊ฐ์ด ๋งž๋Š”์ง€ ํ”ผ๋“œ๋ฐฑํ•ด์ฃผ์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

์ œ๊ฐ€ ์ƒ๊ฐํ•ด๋ณด์ง€ ๋ชปํ–ˆ๋˜ ๋ฐฉ๋ฒ•์ธ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ์ข‹์€ ๋ฐฉ๋ฒ• ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.๐Ÿ˜

๋งจ ์ฒ˜์Œ ๋ฌธ์ œ์— ์ ‘๊ทผํ•˜์˜€์„ ๋•Œ ์„ค๋ช…ํ•ด์ฃผ์‹  ๋ฐฉ๋ฒ•๊ณผ ๊ฐ™์€ ๋ฐฉ๋ฒ•์œผ๋กœ ์•„๋ž˜ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•ด ๋ณด์•˜์Šต๋‹ˆ๋‹ค.

def solution(n, works):
    answer = 0
    for i in range(n):
        works.sort()
        if works[-1]:
            works[-1]-=1
    return sum([x**2 for x in works])

๋ง ๊ทธ๋Œ€๋กœ ๋งค ์ˆœ๊ฐ„ ์˜ค๋ฆ„์ฐจ์ˆœ ํ•˜์—ฌ ์ตœ๋Œ€๊ฐ’์—์„œ 1 ์„ ๋นผ๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค.

์ •ํ™•๋„ ๋ถ€๋ถ„์—์„œ๋Š” ๋งŒ์ ์„ ๋ฐ›์•˜์œผ๋‚˜ ํšจ์œจ์„ฑ์—์„œ ๋ชจ๋‘ ์‹œ๊ฐ„์ดˆ๊ณผ๊ฐ€ ๋œจ๋Š” ๊ฒฐ๊ณผ๊ฐ€ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

์ฝ”๋“œ๋ฅผ ์ œ๋Œ€๋กœ ํŒŒ์•…ํ•ด ์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘

@9kyo-hwang
Copy link

from heapq import *

def solution(n, works):
    heapify(works := [-work for work in works])  # ๋ฐ”๋‹ค์ฝ”๋ผ๋ฆฌ ์—ฐ์‚ฐ์ž๋ฅผ ์ด์šฉํ•ด ๋‚ด๋ถ€ ์›์†Œ๋ฅผ ์ „๋ถ€ ์Œ์ˆ˜๋กœ ๋ฐ”๊พผ ์ƒˆ ๋ฆฌ์ŠคํŠธ๋กœ ๋ณ€๊ฒฝ
    for _ in range(min(n, abs(sum(works)))):  # ๋‚จ์€ ์‹œ๊ฐ„๋™์•ˆ ๋ฐ˜๋ณต(๋‹จ, ๋‚จ์€ ๊ทผ๋ฌด๊ฐ€ ์—†์„ ๊ฒฝ์šฐ break)
        heappush(works, heappop(works) + 1)  # max heap์„ ์œ„ํ•ด ์Œ์ˆ˜๋กœ ๋„ฃ์—ˆ๊ธฐ ๋•Œ๋ฌธ์— -1์ด ์•„๋‹Œ +1
    return sum([work * work for work in works])  # ๊ฒฐ๊ตญ ์ œ๊ณฑ ๊ณผ์ •์œผ๋กœ ์ธํ•ด ๊ฒฐ๊ณผ๋Š” ๋™์ผํ•ด์ง

๋‹ค๋ฅธ ์‚ฌ๋žŒ ํ’€์ด ์ค‘์— ๋ ์šฉํ•œ ์ฝ”๋“œ๊ฐ€ ์žˆ์–ด์„œ ๋“ค๊ณ ์™€๋ดค์Šต๋‹ˆ๋‹ค ใ…‹ใ…‹

@kjs254
Copy link
Member Author

kjs254 commented Feb 20, 2024

from heapq import *

def solution(n, works):
    heapify(works := [-work for work in works])  # ๋ฐ”๋‹ค์ฝ”๋ผ๋ฆฌ ์—ฐ์‚ฐ์ž๋ฅผ ์ด์šฉํ•ด ๋‚ด๋ถ€ ์›์†Œ๋ฅผ ์ „๋ถ€ ์Œ์ˆ˜๋กœ ๋ฐ”๊พผ ์ƒˆ ๋ฆฌ์ŠคํŠธ๋กœ ๋ณ€๊ฒฝ
    for _ in range(min(n, abs(sum(works)))):  # ๋‚จ์€ ์‹œ๊ฐ„๋™์•ˆ ๋ฐ˜๋ณต(๋‹จ, ๋‚จ์€ ๊ทผ๋ฌด๊ฐ€ ์—†์„ ๊ฒฝ์šฐ break)
        heappush(works, heappop(works) + 1)  # max heap์„ ์œ„ํ•ด ์Œ์ˆ˜๋กœ ๋„ฃ์—ˆ๊ธฐ ๋•Œ๋ฌธ์— -1์ด ์•„๋‹Œ +1
    return sum([work * work for work in works])  # ๊ฒฐ๊ตญ ์ œ๊ณฑ ๊ณผ์ •์œผ๋กœ ์ธํ•ด ๊ฒฐ๊ณผ๋Š” ๋™์ผํ•ด์ง

๋‹ค๋ฅธ ์‚ฌ๋žŒ ํ’€์ด ์ค‘์— ๋ ์šฉํ•œ ์ฝ”๋“œ๊ฐ€ ์žˆ์–ด์„œ ๋“ค๊ณ ์™€๋ดค์Šต๋‹ˆ๋‹ค ใ…‹ใ…‹

์ œ๊ณฑ์„ ํ•˜๋‹ˆ ๋ฐฐ์—ด ์•ˆ์˜ ์›์†Œ ๋ถ€ํ˜ธ๊ฐ€ ์ƒ๊ด€์ด ์—†๋„ค์š”

์™œ ์ด ์ƒ๊ฐ์„ ๋ชปํ–ˆ์„๊นŒ์š”!!!!

tuple์„ ์ด์šฉํ•˜์—ฌ max heap์„ ๋งŒ๋“ค์ง€ ์•Š์•„๋„ ๋˜๋Š” ๊ฐ€์žฅ ์‹ฌํ”Œํ•˜๊ณ  ๋น ๋ฅธ ์ฝ”๋“œ ๋ฐฐ์šฐ๊ณ  ๊ฐ‘๋‹ˆ๋‹ค.

Copy link
Collaborator

@YIM2UL2ET YIM2UL2ET left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์„ค๋ช…์„ ํ† ๋Œ€๋กœ heap ๊ณต๋ถ€๋ฅผ ์กฐ๊ธˆ ํ•ด๋ดค๋Š”๋ฐ ์ง€์†์ ์œผ๋กœ ์ตœ๋Œ€๋‚˜ ์ตœ์†Ÿ๊ฐ’์„ ์ฐพ์„ ๋•Œ ์ •๋ง ํšจ์œจ์ ์ด๋„ค์š”. ์ข‹์€ ์•„์ด๋””์–ด ์–ป์–ด๊ฐ‘๋‹ˆ๋‹ค. ์ˆ˜๊ณ ํ•˜์…จ์Šต๋‹ˆ๋‹ค!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants