chore(cpp): update skeleton

Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
Matej Focko 2023-07-10 14:23:09 +02:00
parent 2ef0fc35e0
commit fddc548fbb
Signed by: mfocko
GPG key ID: 7C47D46246790496

View file

@ -1,18 +1,28 @@
#include <iostream> #include <iostream>
namespace { namespace helpers {
using namespace std; using namespace std;
long pow(long base, long exp) { long pow(long base, long exp) {
if (exp == 0) if (exp == 0) return 1;
return 1;
long half = pow(base, exp / 2); long half = pow(base, exp / 2);
if (exp % 2 == 0) if (exp % 2 == 0) return half * half;
return half * half;
return half * half * base; return half * half * base;
} }
template <typename T>
inline void answer(const T &ans) {
cout << ans << "\n";
}
} // namespace helpers
namespace {
using namespace std;
using namespace helpers;
void solve() { void solve() {
// TODO // TODO
} }
@ -22,7 +32,15 @@ void solve() {
// for single test case, comment out for N test cases // for single test case, comment out for N test cases
#define SINGLE #define SINGLE
#ifndef TEST #ifdef TEST
#include "../.common/cpp/catch_amalgamated.hpp"
TEST_CASE("examples") {
// TODO
}
#else
int main(void) { int main(void) {
@ -45,10 +63,4 @@ int main(void) {
return 0; return 0;
} }
#else
#include "../.common/cpp/catch_amalgamated.hpp"
// TODO
#endif #endif