Itachi_Uchiha13's blog

By Itachi_Uchiha13, history, 14 months ago, In English

In this problem 1857/F, I used a binary search to solve this. I wrote the code in Go, but it is giving TLE. I'm not very experienced with Go, so I'd really appreciate it if someone could explain why this is happening.

Link to submission: 222520517

Thanks for the help in advance!

  • Vote: I like it
  • +5
  • Vote: I do not like it

| Write comment?
»
14 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Itachi_Uchiha13 (previous revision, new revision, compare).

»
14 months ago, # |
  Vote: I like it +3 Vote: I do not like it
»
14 months ago, # |
  Vote: I like it +3 Vote: I do not like it

You can apply fast IO for Go.

And pass numCount by reference:

func getValue(x, y int64, numCount *map[int64]int64) int64

  • »
    »
    14 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thanks! I was curious though, I read that maps are reference types, so they are not copied anyways. Could you please confirm that?