Comments
0

what if we do not process the nodes in reverse order? i think that will not change anything.

Can you explain your this solution a little bit please?

Sir can you reply if https://atcoder.jp/contests/dp/tasks/dp_q this is solved by persistent segment trees only?

On RockyB → Problem recommendations, 6 years ago
0

lol segment tree might give you memorylimit exceeded and you are talking about lazy

can you explain this please?

what are exactly laddus? i never understand this word. 250 ladus?

link not working

can anyone please explain D

thanks can you just tel if this approach is correct? int main() { int x, y; cin>>x>>y; int dp[1000]={0};

for(int  i = x; i <= 100; i++){

                 if(!dp[2*i])       
         dp[2*i] = dp[i] + 1;
                   if(!dp[i+1])
         dp[i+1] = dp[i] + 1;

}

for(int i = x; i< 20; i++){
    cout<<i<<" "<<dp[i]<<endl;
}

}

thanks a lot. it really helped

No you explained really well thanks a lot.

Can you please explain the logic to your solution? I am unable to solve it. how did you use binary search?

On jhjfbsbfkbjfnfnfjfj → Cow and Message, 7 years ago
0

thanks a lot. i tried to dry run this example it is cleared now. basically for calculating of number of subsequences of length 2 we required 2d array of size[26][26] (for the two positions i and j ) . similarly if the question were for length 3 then we would have to create three d array of size 26*26*26. right?

On jhjfbsbfkbjfnfnfjfj → Small Doubt, 7 years ago
0

thanks a lot

On jhjfbsbfkbjfnfnfjfj → Small Doubt, 7 years ago
0

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

yeah i got it. thanks for posting the link man.

for a string 2114 pref[0] would give us 4%2019 pref[1] would give 14%2019 pref[2] would give 114%2019 and pref[3] would give 2114%2019. right? then you afterwards what you implemented using map is unclear to me. please explain this.

map<ll,ll>mp;
ll ans = 0;
for(ll i=0;i<n;i++)
{
    if(pref[i]==0)ans++;
    ans+=mp[pref[i]];
    mp[pref[i]]++;
}

i am not that type of a person trust me. btw i am really sorry. this was just in a funny way. i will not say these things again.

On jhjfbsbfkbjfnfnfjfj → Nice DP Problem, 7 years ago
-8

i understood it thanks

not at all. i am never a fake account. i just got frustrated with this question. i wasted almost 20minutes just reading and still couldn't understand the question. really sorry.

On jhjfbsbfkbjfnfnfjfj → Nice DP Problem, 7 years ago
0

you mean this dp would work dp[i] = dp[i] + 1. where i is one of the primefactors of ith number. right? if yes then the maximum value of this array will be our answer?

can you please explain a little bit?

I completely agree with you bro.

thankss it is cleared

thanks a lot man

On joe69 → Test case downloader, 7 years ago
0

honestly won't make any difference

Thanks a lot poduingi

yeah i tried that it didn't seem to work out

you look like a nerd but your replies are funny

0

codechef hmmmm i seee

On vijasi → Is Rating Inflation Real?, 7 years ago
-28

Does Tanya Romanova love you?

sorry

watched it! really great

thanks a lot

Sample Input ( T followed by N C M where N is the total number of unique coins and C is the number of identical charities and M is the number of coins each charity at least gets (it is either 1, 2 , 3). Sample Input : 3

5 3 1

5 2 2

6 2 3 Sample Output : 25 10 10

thanks a lot. what is pre1 and pre2 and also can you tell about what states you considered in dp and how you deduced it?