Vasillia's blog

By Vasillia, history, 12 months ago, In English

I am getting wa on test1 in my submission of this problem https://mirror.codeforces.com/problemset/problem/1990/E1.

This is my submission: https://mirror.codeforces.com/contest/1990/submission/318085732.

When i run my code manualy on my computer and answer the queries manualy I get correct solution for test1. But when i submit I get wa. Can someone tell me where is the problem in my code? It is possible that my algorithm is wrong for the overall solution of a problem so please dont tell me what solution of problem is.

Full text and comments »

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

By Vasillia, history, 2 years ago, In English

I don't understand why I get MLE on this problem https://mirror.codeforces.com/contest/1955/problem/G when using bfs.

Here is the code: https://mirror.codeforces.com/contest/1955/submission/255789320.

I was able to solve it later with dfs, but I'm still confused why this bfs that i wrote does not work. Obviously the problem is in this queue Q, but after every bfs call it should be empty again, so size of Q is always <= 100 * 100, which should not get out of memory limit. I would appreciate if someone will help me understand this.

Full text and comments »

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

By Vasillia, history, 3 years ago, In English

This is my solution for a problem F Is it flower? from a Div 3 codeforces round 863. https://mirror.codeforces.com/contest/1811/submission/205309461

I dont realy understand why do i get TLE. I think my bfs algorithm passes through every node of the graph only once which i think should not get TLE. Can someone tell me why is this program too slow?

Full text and comments »

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