Please, try EDU on Codeforces! New educational section with videos, subtitles, texts, and problems. ×

Fear_Is_An_Illusion's blog

By Fear_Is_An_Illusion, history, 4 years ago, ,

I know we all miss the old rating calculation formula

• -23

By Fear_Is_An_Illusion, history, 5 years ago, ,

I hacked my own solution for fun, but what surprises is the fact the previous solution with no bug also displays hacked. When i try to hack that code again, it shows unsuccesful hacking attempt..

code with error

code without error (submitted before)

• -1

By Fear_Is_An_Illusion, history, 5 years ago, ,

today my birthday , I want to share happiness of my birthday with codeforces users, codeforces best site

• -31

By Fear_Is_An_Illusion, history, 5 years ago, ,

• +7

By Fear_Is_An_Illusion, history, 5 years ago, ,

how are these submissions judged ? do they reverse run taking the output as input and see if it satisfies the original input conditions ?

• +4

By Fear_Is_An_Illusion, history, 5 years ago, ,

• +56

By Fear_Is_An_Illusion, history, 5 years ago, ,

pattern is fixed

• +10

By Fear_Is_An_Illusion, 5 years ago, ,

How about adding basic filter in submissions of individual users, like seeing only accepted solutions or seeing only TLE solutions ?

• 0

By Fear_Is_An_Illusion, history, 5 years ago, ,

I like graph and geometry problems. These problems I can see solution and draw for small values, which I really like.

I don't like BIT manipulation at all.

What do all you like and not like ?

• +57

By Fear_Is_An_Illusion, history, 5 years ago, ,

hello, in this sum question I have been trying to implement a modified dijsktra but fail. I just want to know if modified dijsktra work here.

• -4

By Fear_Is_An_Illusion, 5 years ago, ,

• +7

By Fear_Is_An_Illusion, 5 years ago, ,

Hi i am back, here is some russian, i love russia

деления места разрыва между сокращенной и полной версией

Используйт (на отдельной строк Содержимое: ваши изменения, е модификацию раньше вас оящий момент текст редактир Блог Избранное Команды Попытки Переписка Соревнования редакти

е русский язык для записи тегов. Все теги будут использованы в нижнем регистре. Примеры: "геометрия", "gcj". Интернациональные слова и сокращения записывайте по-английски, на :) :)

• -22

By Fear_Is_An_Illusion, history, 5 years ago, ,

This Sum, is very nice one, however I can't seem to understand how to prove the formulas in the editorial.

If someone can prove and explain these, then it'll help me apply these to more general cases. Thanks

Editorial

• 0

By Fear_Is_An_Illusion, 5 years ago, ,

Hi, how to edit the default C++ build file in sublime so that it automatically compiles with c++ 11 / c++14 ?

• -24

By Fear_Is_An_Illusion, history, 5 years ago, ,

Hi , every one, I am unable to understand the test filter in solution page.

• +6

By Fear_Is_An_Illusion, 5 years ago, ,

Can anyone say the most time efficient method ?. Thanks and sorry if it is easy question.

• +10

By Fear_Is_An_Illusion, 5 years ago, ,

The last round for advancing into round 2 starts today at 12:00 MSK

Good luck

Edit : Its over, congrats to all who made it.

Practice Link thanks heaton for the tip

• +17

By Fear_Is_An_Illusion, 5 years ago, ,

• +50

By Fear_Is_An_Illusion, 5 years ago, ,

dreamoon rating is on the slide again. I don't know but he seems pretty interested to go down in ratings when he reaches international grandmaster :|

• +17

By Fear_Is_An_Illusion, 5 years ago, ,

• 0

By Fear_Is_An_Illusion, 5 years ago, ,

I think MSN will blast through Real Madrid's defence. So Barcelona for me. What do you all think ?

• -53

By Fear_Is_An_Illusion, 5 years ago, ,

Hi all. I was thinking if CodeForces created a new feature which would enable to hack the code of my *true friends irrespective of their room. Would be so much fun.

*True Friends are those coders who are in your friend list and you are in theirs.

• -64

By Fear_Is_An_Illusion, 5 years ago, ,

So SPOJ upgraded their UI. It looks nice. But I really miss the old look and feel.

• -1

By Fear_Is_An_Illusion, 5 years ago, ,

Hello, this is a post for beginners. Recently I came across a blog of someone asking a very basic simple explanation. I will try my best to explain DFS in as a simple a way as possible. Note, If you know DFS, don't read any further.

DFS (Depth First Search) is an algorithm used to traverse graph or tree. We first select the root node of a tree, or any random node(in case of graph) and explore as far as possible in a branch and then come back to a fixed point. DFS is generally used for connectivity questions. It has a time complexity of O(N+E) Where N is the total number of nodes and E is the total number of edges.

Let's take this graph. Here A is connected to E,B,D ; B is connected with A,D,C ; C is connected with B ; D is connected with A,B and E is connected with A ; F is not connected.

We represent this graph using an Adjacency List. Here is the code (in Python)

graph={ 'A':['E','B','D'],
'B':['A','D','C'],
'C':['B'],
'D':['A','B'],
'E':['A']}


Once we have the list, we perform DFS. Basically, we pick a node. Then we keep track if we have visited the nodes directly and indirectly connected to it. Since we are traversing downwards, we use a stack and we'll use it's last in first out(LIFO) feature. We also keep a list of all the nodes we have visited since we have to visit each node only once. So we will add an node to the stack only if that node has not been visited. On visiting a particular node we remove it from the stack. Finally, we'll end up visiting all the nodes and then the stack will be empty. That will serve as the terminating condition.

Here are the steps to follow while performing DFS.

• Select a node. Since we have selected the node, add it to the visited list.
• Look at all the adjacent nodes. Add those nodes which have not been visited to the stack.
• Then pop the top node and Follow the first two steps.

Now, let us pick any node (say A) and perform DFS.

1. We have selected the node A. We now add A to the list of nodes we have visited(which is empty initially). The nodes directly connected to A are E,B,D. So since we havent visited those nodes, we add them to the stack s. Now s=[E,B,D] and visited=[A]
2. We pop s, and we get D. Now D is connected directly with A,B. Since we have visited A, we dont add it. So now s=[E,B] and visited=[A,D].
3. We pop s, and we get B. Now B is connected directly to A,D,C. Since we have visited A,D we dont add it. However as we have not visited C, we add it to stack s. So now s=[E,C] and visited=[A,D,B]
4. We pop s, we get C. Since we have visited all nodes connected to C, we dont push anything to the stack s. So now s=[E] and visited=[A,D,B,C]
5. We pop s, we get E. Since we have visited all nodes connected to E, we dont push anything to the stack s. So now s=[] and visited=[A,D,B,C,E]

Now the stack is empty, and the DFS has been completed. The answer lies in the order we visited in the visited list.

Sample iterative implementation.

graph={ 'A':['E','B','D'],
'B':['A','D','C'],
'C':['B'],
'D':['A','B'],
'E':['A']}

def dfs(graph,s):
stack=[]
visited=[]
stack=[s]
while stack:
node=stack.pop()
if node not in visited:
visited.append(node)
stack=stack+graph[node]
return visited


Hope this helps you.

Thanks for your attention :) :)

• +7

By Fear_Is_An_Illusion, 5 years ago, ,