filo's blog

By filo, history, 3 years ago, In English

Hi,

Relatively new to Python,

Here are two solutions one gets run time error another one gets accepted, basically the difference between two is that the first one uses DFS and the second one BFS. I know Python has limited stack size by default, that's why I increased it to 2000000, but didn't help, any idea why?

Read more »

 
 
 
 
  • Vote: I like it
  • -1
  • Vote: I do not like it

By filo, history, 4 years ago, In English

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!

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By filo, 8 years ago, In English

Hello all,the title says everything,cannot figure out what's wrong,if you've any advices post in comments please.Thanks for your time. Link to problem. Link to my code.

UPDATE: got AC

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By filo, 8 years ago, In English

So this problem is about finding the closest pair of points on the plane,here's my code which gets TLE. I think my code should work in logarithmic time,but it doesn't seem so.So I kindly ask to provide any advices or improvements,for those people who will try to help me,for simplicity,comments are inserted in the code.

Thanks.

UPDATE: Got accepted thanks to Alex_2oo8's observations,no more help needed

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By filo, 8 years ago, In English

Hey guys,recently I've been stuck on this problem,I've written greedy solution and on the test cases I've tried the solution I've submitted gives the correct answer,anyways on judge I've WA.Here's my code . I'll describe algorithm later,if it is necessary.Thanks in advance ;)

UPDATE:

got AC,had to add one if statement :|

Read more »

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

By filo, 9 years ago, In English

cannot enter TC Arena the whole day,does anyone have the same problem or it's just me?

Read more »

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

By filo, 9 years ago, In English

After this contest (138 div2) my rating has been decreased two times for the same contest(look at my profile for details).Any ideas why this could happen?

Read more »

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

By filo, 9 years ago, In English

Hi,i'm going to start learning java,if you know any useful links that will help please write in comments.Thanks in advance :)

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it