I started to do programming contests in go (just to learn the language) and to my surprise found that
var T int fmt.Scanf("%d", &T) is unimaginably slow. How slow? To read 10^5 integers it take me 2.5 seconds (in comparison python does it in 0.8 secs).
So why is it so slow and how should I properly read int, uint64 and float64?
bufio? Whyfmt.Scanfand not juststrconv.Atoi? Post the code, there's not enough info.fmt.Scanfwhich means that no, I have not usedbufio). Why not juststrconv.Atoibecause I found how to read an integer in the answer on stackoverflow and it was telling to use scanf. I think it is more than enough info to understand what I am talking about.stdinand have to write your answer instdout