Initialize internal temperatures. set(index,value) replaces; min(left,right) returns minimum of [left,right), nullopt for empty. Return only query results. Unknown op, invalid set index, or range outside 0<=left<=right<=n throws invalid_argument. Prototype copy/scan; final O(n) build/space, O(log n) updates/queries. Preserve inputs on failure too.
Public signatures:
Vec<Opt<Int>> prototype(const Vec<Int>& temps,const Vec<std::tuple<std::string,Int,Int>>& commands);
Vec<Opt<Int>> solve(const Vec<Int>& temps,const Vec<std::tuple<std::string,Int,Int>>& commands);Compile and run from this directory:
c++ -std=c++20 -O2 -Wall -Wextra -pedantic -pthread main.cpp -o practice
./practice --stage prototype
./practice --stage finalEdit exercise.hpp. Both stages start unfinished and must report failures until implemented. Keep main.cpp as the executable contract. The runner returns nonzero for a failed check, an unexpected exception, an invalid stage, or an empty suite. C++20 and only the standard library are required.
Complete the starter code, then run the checks.
Results and errors will appear here.
C++ runtime powered by Wasmer.