chore(cpp): don't use namespaces in skeleton

Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
Matej Focko 2023-07-29 15:57:32 +02:00
parent 42315a22b8
commit 17e43f0ebf
Signed by: mfocko
GPG key ID: 7C47D46246790496

View file

@ -20,15 +20,9 @@
#include <string>
#include <vector>
template <typename T, typename U>
std::ostream &operator<<(std::ostream &s, std::pair<T, U> const &p) {
return s << p.first << " " << p.second;
}
namespace helpers {
namespace math {
#pragma region helpers
#pragma region math
static constexpr std::int32_t MODULO = 1000000007;
long pow(long base, long exp) {
@ -37,11 +31,25 @@ long pow(long base, long exp) {
if (exp % 2 == 0) return half * half;
return half * half * base;
}
#pragma endregion /* math */
} // namespace math
#pragma region output
template <typename T, typename U>
std::ostream &operator<<(std::ostream &os, std::pair<T, U> const &p) {
return os << p.first << " " << p.second;
}
namespace input {
template <typename T>
inline void answer(const T &ans) {
std::cout << ans << "\n";
}
inline void yes() { std::cout << "YES\n"; }
inline void no() { std::cout << "NO\n"; }
inline void yesno(bool ans) { std::cout << (ans ? "YES" : "NO") << "\n"; }
#pragma region input
template <typename T>
std::vector<T> load_vector(std::size_t size) {
std::vector<T> result{};
@ -54,31 +62,12 @@ std::vector<T> load_vector(std::size_t size) {
return result;
}
#pragma endregion /* input */
} // namespace input
namespace output {
template <typename T>
inline void answer(const T &ans) {
std::cout << ans << "\n";
}
inline void yes() { std::cout << "YES\n"; }
inline void no() { std::cout << "NO\n"; }
inline void yesno(bool ans) { std::cout << (ans ? "YES" : "NO") << "\n"; }
} // namespace output
using namespace std;
using namespace math;
using namespace input;
using namespace output;
#define LOOP(var, n) for (auto var = 0; var < n; ++var)
} // namespace helpers
#pragma endregion /* helpers */
// for N test cases, uncomment for single test case
// #define SINGLE
@ -86,7 +75,6 @@ using namespace output;
namespace solution {
using namespace std;
using namespace helpers;
void solve() {
// TODO