Last active
December 30, 2024 03:42
-
-
Save Apocryphon-X/78f08bc12c02dee5d869380c2904429a to your computer and use it in GitHub Desktop.
[C++] Template for Competitive Programming
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef LOCAL | |
#define _FORTIFY_SOURCE 2 | |
#define _GLIBCXX_DEBUG_PEDANTIC | |
#define _GLIBCXX_DEBUG | |
#define debug(x) \ | |
std::cerr << std::boolalpha << "\x1b[33m[DEBUG] " \ | |
<< #x" = " << x << "\x1b[0m\n" | |
#else | |
#define NDEBUG 1 | |
#define debug(x) 1 | |
#endif | |
// #pragma GCC target ("avx,avx2") | |
// #pragma GCC optimize ("Ofast") | |
#include <bits/stdc++.h> | |
using i16 = short; | |
using i64 = long long; | |
using f32 = float; | |
using f64 = double; | |
using vi32 = std::vector<int>; | |
using mi32 = std::vector<vi32>; | |
using pi32 = std::pair<int, int>; | |
// using ui128 = __uint128_t; | |
// using i128 = __int128_t; | |
// using f128 = long double; | |
#define rep(i, a, b) for (int i = a; i <= b; i++) | |
#define irep(i, a, b) for (int i = a; i >= b; i--) | |
#define all(v) (v).begin(), (v).end() | |
#define rall(v) (v).rbegin(), (v).rend() | |
#define sz(v) (v).size() | |
#define pb push_back | |
#define eb emplace_back | |
#define ef emplace_front | |
#define pf push_front | |
constexpr int INF = INT_MAX; | |
constexpr int MOD = (int)(1e9) + 7; | |
constexpr f64 EPS = 1e-9; | |
constexpr f64 PI = 3.14159265358979323846; | |
template <class T1, class T2> | |
std::ostream &operator <<(std::ostream &out, const std::pair<T1, T2> &p) { | |
out << '(' << p.first << ", " << p.second << ')'; | |
return out; | |
} | |
template <template <class...> class Container, class... T> | |
std::ostream &operator <<(std::ostream &out, const Container<T...> &cont) { | |
for(auto i: cont) { out << i << ' '; } | |
return out; | |
} | |
int main() { | |
std::ios_base::sync_with_stdio(false); | |
std::cin.tie(nullptr); | |
// std::cout.setf(ios::fixed); | |
// std::cout.precision(12); | |
// std::freopen("input.in", "r", stdin); | |
// std::freopen("output.out", "w", stdout); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment