typedef long long int LL; <\/pre>\n\n\n\nUsing the above line, instead of writing :<\/p>\n\n\n\n
long long int a = 10;\nlong long int b = 20;<\/pre>\n\n\n\nWe can use,\u00a0 LL a = 10;<\/strong> LL b = 20;\u00a0 <\/strong>and this will save your time.<\/p>\n\n\n\n<\/span>C++ Competitive Programming Templates<\/strong><\/span><\/h2>\n\n\n\nUsing the help of macros and typedef you can become more effective in Competitive programming. C++ gives you this edge in every contest.<\/p>\n\n\n\n
Here, is the template you can use or with reference to this you can design your own template :<\/p>\n\n\n\n
#include <bits\/stdc++.h>\nusing namespace std;\n\ntypedef long long LL; \ntypedef pair<int, int> pii; \ntypedef pair<LL, LL> pll; \ntypedef pair<string, string> pss; \ntypedef vector<int> vi; \ntypedef vector<vi> vvi; \ntypedef vector<pii> vii; \ntypedef vector<LL> vl; \ntypedef vector<vl> vvl; \n\n#define FOR(a, b, c) for (int(a) = (b); (a) < (c); ++(a)) \n#define FORN(a, b, c) for (int(a) = (b); (a) <= (c); ++(a)) \n#define FORD(a, b, c) for (int(a) = (b); (a) >= (c); --(a)) \n#define FORSQ(a, b, c) for (int(a) = (b); (a) * (a) <= (c); ++(a)) \n#define FORC(a, b, c) for (char(a) = (b); (a) <= (c); ++(a)) \n#define FOREACH(a, b) for (auto&(a) : (b)) \n#define REP(i, n) FOR(i, 0, n) \n#define REPN(i, n) FORN(i, 1, n) \n#define MAX(a, b) a = max(a, b) \n#define MIN(a, b) a = min(a, b) \n#define SQR(x) ((LL)(x) * (x)) \n#define RESET(a, b) memset(a, b, sizeof(a)) \n#define fi first \n#define se second \n#define mp make_pair \n#define pb push_back \n#define ALL(v) v.begin(), v.end() \n#define ALLA(arr, sz) arr, arr + sz \n#define SIZE(v) (int)v.size() \n#define SORT(v) sort(ALL(v)) \n#define REVERSE(v) reverse(ALL(v)) \n#define SORTA(arr, sz) sort(ALLA(arr, sz)) \n#define REVERSEA(arr, sz) reverse(ALLA(arr, sz)) \n#define PERMUTE next_permutation \n#define TC(t) while (t--) \n\nint main()\n{\n ios_base::sync_with_stdio(false);\n cin.tie(NULL);\n int t;\n TC(cin >> t){\n\n }\n return 0;\n}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"Hello coderz, Welcome to CodingBroz where you learn new tips and tricks about Competitive Programming in C++ and many more programming related stuffs. Today I am going to give you some awesome tips and tricks of competitive programming and tell you about C++ macros so that you can use them effectively and get an amazing […]<\/p>\n","protected":false},"author":3,"featured_media":555,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[75],"tags":[22,89,90],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/www.codingbroz.com\/wp-content\/uploads\/2021\/02\/fast-c-template-using-macros-codingbroz.png","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.codingbroz.com\/wp-json\/wp\/v2\/posts\/553"}],"collection":[{"href":"https:\/\/www.codingbroz.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codingbroz.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codingbroz.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codingbroz.com\/wp-json\/wp\/v2\/comments?post=553"}],"version-history":[{"count":2,"href":"https:\/\/www.codingbroz.com\/wp-json\/wp\/v2\/posts\/553\/revisions"}],"predecessor-version":[{"id":556,"href":"https:\/\/www.codingbroz.com\/wp-json\/wp\/v2\/posts\/553\/revisions\/556"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codingbroz.com\/wp-json\/wp\/v2\/media\/555"}],"wp:attachment":[{"href":"https:\/\/www.codingbroz.com\/wp-json\/wp\/v2\/media?parent=553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codingbroz.com\/wp-json\/wp\/v2\/categories?post=553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codingbroz.com\/wp-json\/wp\/v2\/tags?post=553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}