Nishu_Coder's blog

By Nishu_Coder, history, 15 months ago, In English

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.

Full text and comments »

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

By Nishu_Coder, history, 15 months ago, In English
  • Vote: I like it
  • 0
  • Vote: I do not like it

By Nishu_Coder, history, 15 months ago, In English

Is it possible to gamify the entire problem set. Is there any gamified version of cp available? Anyone with ideas on this topic?

Full text and comments »

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

By Nishu_Coder, history, 16 months ago, In English

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];

}

};

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By Nishu_Coder, history, 17 months ago, In English

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.net/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.

Full text and comments »

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

By Nishu_Coder, history, 17 months ago, In English

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.

Full text and comments »

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

By Nishu_Coder, history, 2 years ago, In English

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.

Full text and comments »

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

By Nishu_Coder, history, 2 years ago, In English

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.net/contest/1711/submission/165671567

Full text and comments »

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

By Nishu_Coder, history, 2 years ago, In English
  • Vote: I like it
  • 0
  • Vote: I do not like it

By Nishu_Coder, history, 2 years ago, In English

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.

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By Nishu_Coder, history, 2 years ago, In English

I cannot say that I can solve 2 problems in an div2 contest because I have only given 17 rated contests. I am struggling in 1100 rated problems during the contests. My only priority right now is to be efficient at 1100 to 1200 rated problems. I sincerely don't understand what to learn, why to learn, How to Learn right now. The things that I have learnt till now is some observational thinking(includes constructive algorithms and some number theory concepts), some bitmasks, very little ideas about binary search. I need some ideas on what to learn next, why to learn that, how to practice, where to practice(If Codeforces then I get lost inside the Problemset and couldn't able to find a way out. In fact filtering problems also doesn't help me either). I desperately need a way out. If anyone can suggest some gym(like some groups) will be helpful to proceed.

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it