Skip to main content
3 of 5
added 35 characters in body
  1. FAST IO

    std::ios_base::sync_with_stdio(false);

Or use getchar_unlocked() and putchar_unlocked() (This should do it)

getchar_unlocked > scanf > cin

  1. Use std::sort over quick sort. (http://stackoverflow.com/questions/4708105/performance-of-qsort-vs-stdsort)