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

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

Hello there guys, I'm new on the platform, so maybe this a known problem or maybe is a mistake made by myself. I'm currently submitting my solutions using Golang, and in three of these submissions I'm having Time limit exceeded on test. This is a common problem when your solution to the problem is very slow, but in my case, I don't think this is the problem. To prove my point I implemented the same algorithm that I was using in Golang, and implemented in Python, and it passed all the test without any problem related to Time limit exceeded on test. I'm inclined to think that there some problem with my Golang implementation, but I don't see the problem really. I will share both implementations in case you have an idea of what could be happening. The problem in which I'm having issues are.

  1. 1549B
  2. 1557A
  3. 1554C

These are my submissions, one in Golang, and the second one in Python. Both implement same algorithm but only the Python is accepted.

Golang

126657829

Python

126658409

If someone has an idea of what could be happening comment without any problem, maybe is a problem of my implementation in Golang. Here are the other two implementations for the other problems that I'm facing the same issue when I implement them in Golang:

126491002 126495204

UPDATE: I discover the cause of this TLE, take a look at this post in case you are interested or just facing the same issue.

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

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

I'm not too familiar with go, but I wrote up a bit of code and it seems like go can read in $$$10^6$$$ ints in 3s (about 7.4 MB). But the max input possible is only 280 KB, so I'm not sure. The implementation looks exactly the same, so I don't know what's going wrong :/