Created
May 26, 2020 08:21
-
-
Save prabodhprakash/a68d4894337de600f6f4ac2fce7a27f4 to your computer and use it in GitHub Desktop.
competitive programming sublime snippet
This file contains 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
<snippet> | |
<content><![CDATA[ | |
#include <bits/stdc++.h> | |
using namespace std; | |
//error | |
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); } | |
void err(istream_iterator<string> it) {} | |
template<typename T, typename... Args> | |
void err(istream_iterator<string> it, T a, Args... args) { | |
cerr << *it << " = " << a << endl; | |
err(++it, args...); | |
} | |
//output | |
#define output(x) cout << x << endl | |
//input | |
#define input(x) {int x; cout << x << endl;} | |
//loop | |
#define f(i, n) for(int i = 0; i < n; i++) | |
#define fs(i, s, n) for(int i = s; i < n; i++) | |
#define ll long long | |
#define ull long long | |
int main(int argc, char const *argv[]) | |
{ | |
return 0; | |
}]]> | |
</content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>m</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<!--<scope>source.cpp</scope> --> | |
</snippet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is the snippet that I use as template to my CPP solutions for competitive programming. Works on sublime text.