A way to get an integer input quickly?
Recently i'm trying to do competitive programming with C# and i'm curious if there's a way to get an (array of) integer input. The method I all know is this
6 Replies
That's the way
is this the fastest?
or the same mechanism as other stdin functions like scanf in C/C++?
Assuming all input is correct, I can't think of a more performant way
hm got it
I guess benchmarking
.Select()
vs a loop would be one thing
Or you could play around with Console.Read()
and try assembling the numbers yourself, based on the chars the user enters
Might want to ask in #advanced as well, there might be some super low-level way of reading the chars directly from the buffer or somethingokay i got curious if there's some low-level thingy that i might be able to try
thanks