We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Data Structures
- Heap
- QHEAP1
- Discussions
QHEAP1
QHEAP1
Sort by
recency
|
422 Discussions
|
Please Login in order to post a comment
PYTHON3 SOLUTION:
I learned from Google AI, but I think I improved upon it :)
import heapq
myheap = [] heapq.heapify(myheap)
Q = int(input()) valid = set()
for _ in range(Q):
Are we supposed to implement the heap ourselves or can we use Python's built-in heapq for the heap?
How is this easy lol