diff --git a/.common/cpp/skeleton.cpp b/.common/cpp/skeleton.cpp index 2699a76..d836ae2 100644 --- a/.common/cpp/skeleton.cpp +++ b/.common/cpp/skeleton.cpp @@ -20,11 +20,9 @@ std::ostream &operator<<(std::ostream &s, std::pair const &p) { namespace helpers { -using namespace std; - namespace math { -static constexpr int32_t MODULO = 1000000007; +static constexpr std::int32_t MODULO = 1000000007; long pow(long base, long exp) { if (exp == 0) return 1; @@ -56,27 +54,22 @@ namespace output { template inline void answer(const T &ans) { - cout << ans << "\n"; + std::cout << ans << "\n"; } -inline void yes() { cout << "YES\n"; } -inline void no() { cout << "NO\n"; } - -inline void yesno(bool ans) { - if (ans) { - yes(); - } else { - no(); - } -} +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(n) for (auto i = 0; i < n; ++i) +#define LOOP(var, n) for (auto var = 0; var < n; ++var) } // namespace helpers