MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / fix

Method fix

code/data-structures/monotonic_queue.cpp:13–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11 min_stack inp, outp;
12 void push(int x) { inp.push(x); }
13 void fix() {
14 if (outp.empty()) while (!inp.empty())
15 outp.push(inp.top()), inp.pop(); }
16 int top() { fix(); return outp.top(); }
17 int mn() {
18 if (inp.empty()) return outp.mn();

Callers

nothing calls this directly

Calls 4

emptyMethod · 0.45
pushMethod · 0.45
topMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected