diff --git a/.common/cpp/skeleton.cpp b/.common/cpp/skeleton.cpp index 6f4ee9e..d39ba41 100644 --- a/.common/cpp/skeleton.cpp +++ b/.common/cpp/skeleton.cpp @@ -1,18 +1,28 @@ #include -namespace { +namespace helpers { using namespace std; long pow(long base, long exp) { - if (exp == 0) - return 1; + if (exp == 0) return 1; long half = pow(base, exp / 2); - if (exp % 2 == 0) - return half * half; + if (exp % 2 == 0) return half * half; return half * half * base; } +template +inline void answer(const T &ans) { + cout << ans << "\n"; +} + +} // namespace helpers + +namespace { + +using namespace std; +using namespace helpers; + void solve() { // TODO } @@ -22,7 +32,15 @@ void solve() { // for single test case, comment out for ‹N› test cases #define SINGLE -#ifndef TEST +#ifdef TEST + +#include "../.common/cpp/catch_amalgamated.hpp" + +TEST_CASE("examples") { + // TODO +} + +#else int main(void) { @@ -45,10 +63,4 @@ int main(void) { return 0; } -#else - -#include "../.common/cpp/catch_amalgamated.hpp" - -// TODO - -#endif \ No newline at end of file +#endif