Skip to main content

My Roadmap

My Setups - cpp java python 🔥​

tip
#include<bits/stdc++.h>
using namespace std;

typedef vector <int> vi;
typedef pair< int ,int > pii;
#define endl "\n"
#define sd(val) scanf("%d",&val)
#define ss(val) scanf("%s",&val)
#define sl(val) scanf("%lld",&val)
#define debug(val) printf("check%d\n",val)
#define all(v) v.begin(),v.end()
#define PB push_back
#define MP make_pair
#define FF first
#define SS second
#define ll long long
#define MOD 1000000007
#define clr(val) memset(val,0,sizeof(val))
#define what_is(x) cerr << #x << " is " << x << endl;
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);


int main()
{

ios::sync_with_stdio(false);
cin.tie(nullptr);

// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);

return 0;
}
  • Use using instead of typedef, for example using ll = long long;.

  • Use auto to increase readability and decrease code size.

  • Use ios::sync_with_stdio(false); and cin.tie(nullptr); for faster Input/Output using cin/cout.

  • Use builtin functions starting with __builtin.

  • GCD and LCM are available in ***C++17*** under `gcd` and `lcm`.
  • Use C++11 for-each style for loops for (auto& elem : vec).

  • Use C++17 binding style like for (auto& [key, val] : dic) and auto [x, y] = myPoint;

  • Use C++17 template argument deduction pair p{1, 2.5}; instead of pair<int, double> p{1, 2.5};.

  • If you have a lot of nested loops and conditions, refactor! You probably should be using functions.

  • Never use goto! But be brave enough to use goto when you want to break from several nested loops (in case you just can't refactor it)!

  • Some websites like codeforces use the flag -DONLINE_JUDGE to compile your code, this means that you can remove your cerrs or your debug functions automatically or redirect input/output to file instead of stdin/stdout, etc.


Debugging C++ Template​

#include<bits/stdc++.h>

using namespace std;

#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define MOD 1000000007
#define MOD1 998244353
#define INF 1e18
#define nline "\n"
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define ff first
#define ss second
#define PI 3.141592653589793238462
#define set_bits __builtin_popcountll
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef unsigned long long ull;
typedef long double lld;
// typedef tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, tree_order_statistics_node_update > pbds; // find_by_order, order_of_key

#ifndef ONLINE_JUDGE
#define debug(x) cerr << #x <<" "; _print(x); cerr << endl;
#else
#define debug(x)
#endif

void _print(ll t) {cerr << t;}
void _print(int t) {cerr << t;}
void _print(string t) {cerr << t;}
void _print(char t) {cerr << t;}
void _print(lld t) {cerr << t;}
void _print(double t) {cerr << t;}
void _print(ull t) {cerr << t;}

template <class T, class V> void _print(pair <T, V> p);
template <class T> void _print(vector <T> v);
template <class T> void _print(set <T> v);
template <class T, class V> void _print(map <T, V> v);
template <class T> void _print(multiset <T> v);
template <class T, class V> void _print(pair <T, V> p) {cerr << "{"; _print(p.ff); cerr << ","; _print(p.ss); cerr << "}";}
template <class T> void _print(vector <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(set <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(multiset <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T, class V> void _print(map <T, V> v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";}

int main() {
#ifndef ONLINE_JUDGE
freopen("Error.txt", "w", stderr);
#endif

// Code

}


Visualisations​


Cpp Documentations:​


Java Documentations:​


Learning DSA​

https://codeforces.com/blog/entry/57282

Resources I am Following:​


Other Resources​

  • Codeforces Blogs
  • InterviewBit Blogs

Must Use Resources to Learn:​

  1. java acad__
  2. HackerEarth Notes / Code Monk
  3. InterviewBit Materials
  4. Educative-> Grokking the Coding InterviewBit
  5. CP- Algorithms
  6. GeeksforGeeks
  7. TopCoder Blogs
  8. CodeForces Blogs
  9. CodeChef Resources
  10. algoExperts
  11. Atcoder Begineer and Regular Editorials

TopicWise:​

Dynamic Programming​


Guides:​

  1. The Guide
  2. hSkill Roadmap
  3. Codechef Certificate: https://www.codechef.com/certification/data-structures-and-algorithms/prepare
  • Resources Links:
  1. https://techprep.org/ by Facebook

Websites to prepare for Aptitude/ Reasoning:​

  1. FreshersWorld
  2. Puzzlefry
  3. IndiaBIX
  4. AmbitionBox
  5. Fresherslive

...

  • Linkedin
  • Internshala
  • Careers
  • U dg
caution

Caution Section

Hackathons​