peaceful_warrior's blog

By peaceful_warrior, history, 6 years ago, In English

So you have an array A of size N. Let's say 10 20 40 80 10 What we have to do it divide the array into two subSequence such that. The difference between the absolute value of first and second is minimum. in the above case, the answer would. first subSequence 10, 10 = 0 second 20 40 80. = (20 + 40) = 60

can anyone help?

Full text and comments »

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

By peaceful_warrior, history, 9 years ago, In English

Problem link Hi i am trying a variant of the above problem. with probabilty introduced with each node

From same problem our simplified but complicated version. Now lets assume from root ,all the vertices are directly connected to the root. But we the probability of selection of node i is p[i] such that any p[i]>0 and sum of p[i] is 1 We have to find the expected chances to delete the whole tree..same as the original problem

Now to deleted the root probability p[root] but now to delete the the children probability of direct removal is p[child]/p[root]+p[child]; But when i simulate i am getting wrong answer.. Can anybody help me where approach is going wrong

Full text and comments »

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

By peaceful_warrior, history, 9 years ago, In English

Problem link I have seen the solution but i dont understand how the recurrance relation is dp[i]=dp[i-1]+dp[i-2]+2;

Can somebody explain it to me.

Full text and comments »

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

By peaceful_warrior, 10 years ago, In English

I am getting wrong answer for Test Case 4(Problem C) : http://codeforces.net/contest/546/submission/11226594

But When I run the same Code in Ideone and My Linux Machine I am getting the correct output.

MY code (same as submission Link above): http://ideone.com/NmWgjc

Don't Know why Such Weird Problem is happening. Any Help Will be Appreciated.

Full text and comments »

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

By peaceful_warrior, 10 years ago, In English

How would one compare TC Rating vs Codeforces Rating i want to know what is range to compare a TC rating with codeforces Like a guy rated 1700 in codeforces is equivalent to to what in TC.

Full text and comments »

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