I am currently giving codechef long challenge and there they are asking to flush the output after printing each line. How to use flush in cpp and how does this affect the time limit if I am not using flush? Currently I am using this code-
cout<<z<<" "<<endl;
cout.flush();