Reading strings gets TLE in Go

Revision en1, by filo, 2017-11-28 19:14:01

Hi all,

I know Go isn't the most popular language when it comes to competitive programming but since it is added on CF I will ask this question.

In this problem I try to read two strings, the problem is that Go's bufio.Text() or bufio.ReadLine() cannot read million characters in one string.

I've tried lots of other options as well(already -57 on that problem), like increasing buffer size for Scanner, or concatenating parts of strings returned from bufio.ReadLine() but all of them gets TLE.

I am almost sure that the solution itself is pretty fast and the problem is in reading from the input.

If you have any idea how to speed it up you are welcome!

Tags #tle, golang, 448

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English filo 2017-11-28 19:14:01 749 Initial revision (published)