Jobs are (unique_id,start,end), with end>start. Duplicate IDs or invalid durations throw invalid_argument. Sort by (end,start,id), accept each job whose start>=last accepted end, return IDs in that order. Empty returns empty; negative times and touching jobs are valid. Prototype subset exploration must reproduce this canonical optimum; final greedy O(n log n). Preserve input.
Public signatures:
Vec<std::string> prototype(const Vec<std::tuple<std::string,Int,Int>>& jobs);
Vec<std::string> solve(const Vec<std::tuple<std::string,Int,Int>>& jobs);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.