From c8035c22dc8b52afe43b64f1bd0422f95a1b6943 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Sat, 12 Aug 2023 23:16:08 +0200 Subject: [PATCH] chore(cpp): introduce aliases Signed-off-by: Matej Focko --- .common/cpp/skeleton.cpp | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.common/cpp/skeleton.cpp b/.common/cpp/skeleton.cpp index 7dfbc25..72e96c9 100644 --- a/.common/cpp/skeleton.cpp +++ b/.common/cpp/skeleton.cpp @@ -22,6 +22,31 @@ #pragma region helpers +#pragma region aliases +#define LOOP(var, n) for (auto var = 0; var < n; ++var) + +template +using V = std::vector; + +template +using M = std::map; + +template +using S = std::set; + +template +using Q = std::deque; + +using i8 = std::int8_t; +using u8 = std::uint8_t; +using i16 = std::int16_t; +using u16 = std::uint16_t; +using i32 = std::int32_t; +using u32 = std::uint32_t; +using i64 = std::int64_t; +using u64 = std::uint64_t; +#pragma endregion /* aliases */ + #pragma region debug void dbg_out() { std::cerr << std::endl; } template @@ -113,8 +138,6 @@ inline void no() { std::cout << "NO\n"; } inline void yesno(bool ans) { std::cout << (ans ? "YES" : "NO") << "\n"; } #pragma endregion /* output */ -#define LOOP(var, n) for (auto var = 0; var < n; ++var) - #pragma endregion /* helpers */ // for ‹N› test cases, uncomment for single test case