You could read input character by character using getchar_unlocked() untill
you hit a space or new line or EOF.
Alternatively you read the whole input at once using fread_unlocked() and
then process it as per your need.

On Wed, Apr 20, 2011 at 7:41 AM, shubham <[email protected]> wrote:

> Hello Geeks,
> Suppose we have a 2-d array arr[1000][1000] capable of storing 10^6
> elements in it. Input is supplied one row at a time. Then what is the
> best possible way to read this much data in the least amount of time
> as scanf() or cin takes a lot of time?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to