Q:

What the following macro means in competitive programming? 

I watched various tips to make my algorithm take less time on online judges.  But I was stuck on the following code.  
#ifndef ONLINE_JUDGE
freopen(fi, "r", stdin);
freopen(fo, "w", stdout);
#else
// online submission
#endif

A:

This is not about algorithm time.  freopen allows you to redirect standard streams to your files.  Some online judges always use standard input/output streams.  And you must read from stdin and write to stdout.  This macro allows you to write code that will read/write from/to stdin/stdout, but locally it will use your custom files for input and output data. 