Comments
On NBAHCodeforces Round #367 (Div.2), 10 years ago
0

Is there anyone who could help me to solve this problem or give any other approach.Thanks in advance http://mirror.codeforces.com/blog/entry/46505

On sainiarpit12Random question , 10 years ago
0

Thanks.

On sainiarpit12Random question , 10 years ago
0

Any help or what so ever is appreciated .

On GlebsHPCodeforces Round #363, 10 years ago
+6

First find out that there can be any root of the given tree(if any make ans = -1 otherwise 0)

ans = -1 is for when you have p[i] == i case , the root of the tree.

For every i , check whether (i,p[i]) are from the same set , if it is then make the parent of i as root(if any or create this i as root ) and increment ans each time when you find they are from same set.

Here is my code : 19259242

On GlebsHPCodeforces Round #363, 10 years ago
0

Thanks.

On GlebsHPCodeforces Round #363, 10 years ago
0

Can someone explain me the dp solution for the Div2-C/Div1-A ?

On GlebsHPCodeforces Round #363, 10 years ago
-10

The way the TooDifficult has been improved with past rounds , one day sure he may defeat even Petr and tourist . Waiting to see that happen.

On PrinceOfPersiaCodeforces Round #362, 10 years ago
+24

So long that rng_58 has participated on CF. Waiting to see Petr and tourist too.

Hoping to see some good problems and ratings up. All the best to all.

On M.MahdiCodeforces Round #360, 10 years ago
0

Thanks.

On M.MahdiCodeforces Round #360, 10 years ago
0

In Div1-C Problem. What i and j are here ? Are they 2 subset sum ? Errichto Solution 18788820

On M.MahdiCodeforces Round #360, 10 years ago
+19

tourist has been already registered , waiting to see Petr too in the contest.

For the pair of strings to find a and b Lets understand that if a&b=1 , then there would be 1 in both. For a&b = 0, it can happen in three ways 00 ,01,10. As number is less than 64 , it can be represented with 6 bits. So you should check the total number of zeros in every number of 6th bit representation. So ans = 3^tot.

  1. In problem B : How I should approach if given problem is like given index l and r . You have to reverse the string the string from a[l] to a[r].
  2. What would be its approach ?

Thanks.

Thanks , But can you tell me with some more explanation or with some sample example? I didn't got it through.

Auto comment: topic has been updated by sainiarpit12 (previous revision, new revision, compare).

On ErrichtoGood Bye 2015 Editorial, 10 years ago
0

In problem D tourist http://mirror.codeforces.com/contest/611/submission/15107147 Why he(tourist) is adding the value
dp[i — len][i — 1] to the value sum (when added == false) after updating dp[i][j] = sum; ( after updating sum if that number is smaller than that ) why do we need this part, can someone explain ?

if (i — len >= 0 && !added) { add(sum, dp[i — len][i — 1]); } Thank in advance.

On ErrichtoGood Bye 2015 Editorial, 10 years ago
0

Thanks for the explanation

On ErrichtoGood Bye 2015 Editorial, 10 years ago
0

In problem D , Can someone explain me the use of nxt[a][b] should be nxt[a+1][b+1] or 0 with some example and why do need it ? Thanks.

On ciprianfarcasanuRound 53 - Problem C, 11 years ago
0

Why B has numbers from 1 to 2*n -1 ? The problem says only from 1 to n . I didn't understood use of C(2*n-1 , n) .. Any response are welcome . Thanks

Thanks a lot !!

Can someone explain me this code for Problem D : http://mirror.codeforces.com/contest/552/submission/11636769

I know that he is calculating the equation of the line .. But how trip (variable) is working here and also about ans -= trip/3 .... Thanks in advance :)