shivanshsingh9670's blog

By shivanshsingh9670, history, 14 months ago, In English

Question : 1553C

My Solution

"1?0???1001" is the test case my code in failing for.

I have made recursion calls for every scenario but for i=8, firstGoals = 3, secondGoals = 0 {This scenario is not coming. And I don't understand why}

Can someone help me with it please

Full text and comments »

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

By shivanshsingh9670, history, 20 months ago, In English

I have read many blogs, and came to the conclusion that I have to do questions based on ratings. So I started doing 1000 rated questions(by hiding the tags) until I was comfortable and so on increased the difficulty level. Currently I am doing 1400 rated questions. But I feel like my CP skills are not increasing as I expected. I know it might be too early to say that.

I have practiced topics like graphs, DP, trees etc. This is my LeetCode Profile

I'll be glad if someone could give me some tips, like, is it just practice that I need or something more. So this is Codeforces Visualizer , in case you need to check my profile to see my weak points or so.

Full text and comments »

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

By shivanshsingh9670, history, 20 months ago, In English

Question

Submission

I did this question by Segment tree but my solution is throwing TLE. I I think the TC is O(n logn) for larger cases. So I think it should work this way but it is failing. Is it not possible to further optimize it doing this way ?

Full text and comments »

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

By shivanshsingh9670, history, 20 months ago, In English

Question

In my both solutions, i am storing the frequencies of the values in maps and then pushing in priority queue. When I use unordered_map, it throws tle. But if I use map, it is accepted. Can someone explain Why ?

Unordered_map Solution — TLE

Map Solution — Acceppted

Full text and comments »

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

By shivanshsingh9670, history, 20 months ago, In English

Problem : 1324-D Submission : My Solution

It is giving WA, but Test case is long and can't figure out the mistake.

Full text and comments »

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

By shivanshsingh9670, history, 21 month(s) ago, In English

If someone registered for a contest. But didn't made any submissions, then would the rating be updated ?

Full text and comments »

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

By shivanshsingh9670, history, 21 month(s) ago, In English

I was solving a question 1367C.

But my code is failing for certain test cases and I am not able to figure out which test case is it failing for.

Can someone just help me out please.

Submission Link

Full text and comments »

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