Skip to content

Instantly share code, notes, and snippets.

@akshansh2000
Last active August 12, 2020 10:01
Show Gist options
  • Save akshansh2000/fcec95612843b57b8f83510335ca48ef to your computer and use it in GitHub Desktop.
Save akshansh2000/fcec95612843b57b8f83510335ca48ef to your computer and use it in GitHub Desktop.
Macros for CP
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define in(x) \
ll x; \
scanf("%lld", &x);
#define inf(x) \
ld x; \
scanf("%llf", &x);
#define ina(a, n) \
ll a[n]; \
for (ll i = 0; i < n; ++i) scanf("%lld", &a[i]);
#define inc(x) \
char x; \
cin >> x;
#define ins(x) \
string x; \
cin >> x;
#define out(x) cout << (ll)x << endl;
#define outs(x) printf("%s\n", &x[0]);
#define loop(x) for (ll i = 0; i < x; ++i)
#define loopj(x) for (ll j = 0; j < x; ++j)
#define loopn(x) for (ll i = x; i >= 0; --i)
#define pi(a, b, p) pair<ll, ll> p = pair<ll, ll>(a, b);
#define pc(a, b, p) pair<char, ll> p = pair<char, ll>(a, b);
#define sa(a, n) sort(a, a + n);
#define sar(a, n) sort(a, a + n, greater<ll>());
#define sv(a) sort(a.begin(), a.end());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment