I know it may not be relevant to cp but i see some editorials talk about this formula. And how can we generalize it for polynomial of nth degree.

# | User | Rating |
---|---|---|

1 | tourist | 3947 |

2 | ecnerwala | 3654 |

3 | jiangly | 3627 |

4 | jqdai0815 | 3620 |

5 | orzdevinwang | 3612 |

6 | Benq | 3586 |

7 | Radewoosh | 3582 |

8 | Geothermal | 3569 |

8 | cnnfls_csy | 3569 |

10 | ksun48 | 3474 |

# | User | Contrib. |
---|---|---|

1 | awoo | 163 |

2 | maomao90 | 160 |

3 | adamant | 156 |

4 | atcoder_official | 155 |

5 | maroonrk | 152 |

6 | cry | 148 |

6 | -is-this-fft- | 148 |

6 | SecondThread | 148 |

9 | Petr | 147 |

10 | nor | 145 |

Problem link: https://leetcode.com/problems/visit-array-positions-to-maximize-score/ Doubt: I tried with recursive dp but only 711/744 testcases passed. My code:

class Solution { public:

long long fun (int index,int r,long long score2,vector<int>&nums,int n,vector<long long>&dp) { if(index == n) { return 0; } if(dp[index]!=-1e12) { return dp[index]; } long long y = score2; long long start_score = score2; for(int i = index + 1;i<n;i++) { long long temp1 = score2 + fun(i,r,nums[i],nums,n,dp); if((nums[i]%2LL)!=(nums[index]%2LL)) { temp1-=r; } start_score = max(start_score,temp1); } dp[index] = start_score; return dp[index]; } long long maxScore(vector<int>& nums, int x) { int n = nums.size(); vector<int>temp; temp.push_back(0); vector<long long>dp(n); for(int i = 0;i<n;i++) { dp[i] = -1e12; } return fun(0,x,nums[0],nums,n,dp); //return dp[0]; }

};

Attention!

Your solution 206472221 for the problem 1833A significantly coincides with solutions shivam_satyam_/206464201, Nishu Coder/206472221. Such a coincidence is a clear rules violation. Note that unintentional leakage is also a violation. For example, do not use ideone.com with the default settings (public access to your code). If you have conclusive evidence that a coincidence has occurred due to the use of a common source published before the competition, write a comment to post about the round with all the details. More information can be found at http://codeforces.com/blog/entry/8790. Such violation of the rules may be the reason for blocking your account or other penalties. In case of repeated violations, your account may be blocked.

The following complaint was sent to me just 3 hrs ago. Am I supposed to cheat for div3 problem A and that to for a contest that happened on may 19th,but still the system gave me notification after 12 days. even if I cheated then why my rating didn't deducted?. There is a serious bug in your system. please revolve this MikeMirzayanov.

I don't know how to tag Mike in the bold writing. please can anyone do it for me.

Guys please don't downvote my blog. I genuinely need the help. My doubt is if I am given a sequence 1,2,4,8,15,26,... Then how to find a closed formula for this series in this case. please help me. I know this is not relevant to cp. But it will genuinely help to understand the mathematical computation regarding solving subproblems.

As far as i have read this involves polynomial fitting. How to solve this by polynomial fitting . please kindly help.

what strategies do I need to follow to have a convenient grasp on proving various greedy and constructive strategies, approaches of a particular problem during the contests and while doing practice?

Basically what I am asking is how do I master the art of proving greedy and constructive approaches.

if there are m even pairs then the answer is always zero. If there are odd pairs then the first intuition must come is that what if I remove one pair. so in a pair of (x,y) total contribution of x is (1(for y) + other neighbors) and for y ((1(for x) + other neighbors)). now there are 3 possibilities to remove a pair. 1.what if I remove x. 2.what if I remove y. 3.what if I remove both x and y.

for every (x,y) atleast one of the above possibilities gives even number of remaining pairs.

among these 3 possibilities check which one gives even number of remaining pairs and among them calculate the minimum. Likewise check for all possibilities of m pairs.

My solution:https://codeforces.com/contest/1711/submission/165671567

I was discussing with my companion about what should I do to improve on visualizing problems. He pointed out that the biggest weakness of my lack of visualizing problem patterns is that I don't go through the editorials thoroughly. He is absolutely correct I don't read editorials with full enthusiasm. I don't know what is happening right now but I am not able to understand editorials. It would be too embarrassing for me to say that I am not that good at English but I think that the idea of making the editorials interesting should be really important. after all editorials are the only place where someone learns to visualize patterns and understanding various techniques.

Although I am not that person with great understanding of aptitude and Logic but I really aspire to learn more. so as a matter of suggestion I want the editorialist should explain various testcase possibilities, along with corner cases by writing examples ones by one(I would want them to write at least 5 to 6 specific examples explaining their hints and criteria's of the above problem(Not for the obvious idea, but the idea that needs various breakdowns to understand)).

As a contestant it also my responsibility to dry run the solution code. Likewise the editorialist should explain what each line is doing(could be helpful if mentioned in the comments). I hope in future I would be more interested in reading and understanding editorials.

Codeforces (c) Copyright 2010-2024 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Aug/09/2024 03:14:25 (k3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|