Why Go is slow?

Правка en1, от hulm, 2023-10-03 19:11:00

Good morning/afternoon/evening/night dear codeforces community!

I have been learning Go language to start developing in Back-end, so I decided to practice it by solving simple problems from codeforces. However, I am facing a problem in this problem. Initially I implemented sorting by my own comparator to sort the paired(implemented via struct) array. However I got TLE. After that, I implemented merge sort by my own, and even after this I got TLE again. I thought that problem was in binary seacrh(maybe I write something wrong), so I replaced it with two-pointers method. Unfortunately I got TLE again. Can you tell me, is it possible to get "Accepted" in this problem using Golang?

The final version of code is right here -> https://mirror.codeforces.com/problemset/submission/580/226466440

Thanks for your consideration.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский hulm 2023-10-03 19:11:00 974 Initial revision (published)