Блог пользователя Dmohan

Автор Dmohan, история, 3 года назад, По-английски

Hello Codeforces community,

I have been using Golang of late for upsolving problems on Codeforces. I have experienced that for a handful number of contests that even for the best code written on Golang for certain problems, I'd run into TLE while the same logic seem to work fine for other languages(ex: Python, Java) which are below Golang in terms of performance. I am not sure if this is because that i am unrated (and because of that the environment set for unrated is not on par with that of rated users) or if its because the current Golang version is a bit old. Assuming the latter as one of the cause, i would like to request the Codeforces management to upgrade the current version of Golang. If its the former, then please upgrade the go environment(i dont know.. Memory/Heap space perhaps?).

Imagine using Golang as your coding language while participating in a serious contest and running into TLE for a 800 problem and being clueless about why that happens and later you found out that a seemingly terrible logic on a different language (way inferior that Go in terms of performance) seem to work just fine. This scenario would mean that its a waste of time and effort and its doesnt encourage the user to use Go on codeforces or to compete for that matter. I presume the people using Golang as the go-to language for programming on Codeforces is a minority and would request them to support and voice if its a concern.

Thanks, Dmohan (unrated).

  • Проголосовать: нравится
  • -2
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится +14 Проголосовать: не нравится
  1. You should use bufio in Go to make your input faster. Default IO is pretty slow.
  2. CF uses 32-bit x86 machines, which might be the reason behind some of the performance hit.
  3. I am not sure if this is because that i am unrated (and because of that the environment set for unrated is not on par with that of rated users): maybe, not sure.
  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Here is exactly the same solution in go (WA#8) and python (OK). It's an interesting thing because IMHO there is no integer overflow but go-solution gets wa (maybe I'm wrong?). I've created test input with 1e5 zeros and 1e5 ones (my guess is test case #8 is something like that) and both solution print correct 10000000000 locally. I haven't yet figured out why this is so.

»
3 года назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

It would be nice to see the Go and Rust versions updated TBH, I've had a few compile errors recently when trying to use newer language features.