Comments

Can div2B be solved with DP to find the path's string?

My trial: Submission Div2B

q.push_front('1');
q.push_front('0');

If you mean this lines, you have to read it carefully, he is pushing 1 to front first then 0 So it's inserting '01' at front but step by step.

Thanks a lot, that is a lesson learnt, for sure. :(

In problem D, I changed n,x, y type from int to long long and it got accepted. How could this be possible? [n maximum is 10^9]

Wrong answer here

Accepted here

Edit: got it. Sorry, but how did you come up with this condition:

if(((n-1)*(n))/2 > y-x){
        cout<<-1<<endl;
        return;
    }