Skip to content

Instantly share code, notes, and snippets.

@ojbench
ojbench / main.cpp
Created March 31, 2026 19:37
Elevator System Code
#include <cstdio>
#include <iostream>
using namespace std;
const int MAXN = 500005;
// Max heap for floors we need to go down to (stores negative values to use as max heap)
struct MaxHeap {
int arr[MAXN];
int cnt;