Codeforces/.common/cpp/skeleton.cpp
Matej Focko 2ef5f300ca
chore(cpp): add frequently used headers and yes/no
Signed-off-by: Matej Focko <me@mfocko.xyz>
2023-07-10 20:20:19 +02:00

78 lines
1 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <algorithm>
#include <cassert>
#include <cctype>
#include <cstdint>
#include <functional>
#include <iostream>
#include <optional>
#include <sstream>
#include <string>
#include <vector>
namespace helpers {
using namespace std;
long pow(long base, long exp) {
if (exp == 0) return 1;
long half = pow(base, exp / 2);
if (exp % 2 == 0) return half * half;
return half * half * base;
}
template <typename T>
inline void answer(const T &ans) {
cout << ans << "\n";
}
inline void yes() { cout << "YES\n"; }
inline void no() { cout << "NO\n"; }
} // namespace helpers
namespace {
using namespace std;
using namespace helpers;
void solve() {
// TODO
}
} // namespace
// for single test case, comment out for N test cases
#define SINGLE
#ifdef TEST
#include "../.common/cpp/catch_amalgamated.hpp"
TEST_CASE("examples") {
// TODO
}
#else
int main(void) {
#ifdef SINGLE
solve();
#else
// for multiple test cases
int N;
std::cin >> N >> std::ws;
for (auto i = 0; i < N; ++i) {
solve();
}
#endif
return 0;
}
#endif