Skip to content

4. Complexity

  • It's better to use printf, scanf; with the code:
    1
    2
    3
     ios::sync_with_stdio(false);
     cin.tie(NULL);
     cout.tie(NULL);
    
  • Avoid nested loops as possible: Be greedy with your memory resources, only save variables and arrays when you'll use them, in other words, think of there's a way to minimize the number of for loops into only one for loop. (See also: All into one loop)