psywoo's blog

By psywoo, history, 23 months ago, In English

Problem : You are given a connected graph with N nodes and M edges, graph does not contain multiple edges and self loops. An independent set of nodes is the set in which no two nodes are connected to each other. You need to find the largest independent set.

Constraints : 3 <= N <= 1e5 and (N — 1) <= M <= 2e5

Full text and comments »

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

By psywoo, history, 23 months ago, In English

Problem Statement :

You are given a Directed graph with N Vertices and M edges(it may or may not have cycles, it doesn't have multiple edges or self loops) and two vertices Start and End. You need to find the minimum number of vertices you need to block so that there is no way to reach Vertex End from the vertex Start. You cannot block the Start and End vertex.

Constraints :

4 <= N <= 1e5

3 <= M <= min(2e5 , N * (N — 1))

1 <= Start, End <= N

PS : Problem Source not known, But its Definitely not from a live contest :)

Full text and comments »

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

By psywoo, history, 2 years ago, In English

Problem :

You are standing at point (0 , 0). You can move to any point with integer coordinates that is exactly K units away in terms of manhattan distance from the point you are currently standing at. For eg : K = 3 , and you are standing at ( 4, -3) you can go to ( 5 , -5 ) or ( 4 , 0 ) as they both are at a manhattan distance of K (note that there are other options too).

You need to answer the minimum number of moves required to reach point (x , y) or say its impossible to reach (x , y)

Constraints :

-1e5 <= x , y <= 1e5

1 <= K <= 1e9

Sample TC : K = 3

pt = ( 1 , 3 )

output : 2

explanation : In one move you can go from (0 , 0) to (-3 , 2) Distance = |0 — (-3)| + |0 — 2| = 5 , and then from (-3, 2) you can go to (1 , 3) Distance = |-3 — 1| + |2 — 3| = 5 . So 2 moves is the minimum answer.

Full text and comments »

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

By psywoo, history, 3 years ago, In English

So this blog will be harsh , And probably will get many downvotes , but this is the truth/ reality of the community ...

Firstly the community is biased (on ratings) .. By this I mean people often upvote or downvote just by looking at author's rating. You will often see GMs getting tons of likes for no good comment and low rated guys getting downvotes for legit comments and blogs...

Blogs are a way to reach out to people and hence everyone has the right to post whatever they feel right. You should not just downvote or comment harsh just because you feel the blog is stupid ...

So many legit comments are disregarded for no good reason. Whereas Silly comments by GMs are getting upvotes ...

Now , this said , poor comments deserve downvotes but silly comments by GMs also deserve negative votes..

At last I want to clear that I dont care about upvotes and downvotes , I just wanted to tell the fact that I have noticed ...

Full text and comments »

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