I wish to use fast input and output in my code. I understood the use of getchar_unlocked
for fast input using the below function.
inline int next_int() {
int n = 0;
char c = getchar_unlocked();
while (!('0' <= c && c <= '9')) {
c = getchar_unlocked();
}
while ('0' <= c && c <= '9') {
n = n * 10 + c - '0';
c = getchar_unlocked();
}
return n;
}
can someone please explain me how to use fast output using putchar_unlocked()
function?
I was going through this question and there someone said putchar_unlocked()
could be used for fast output.