hello_hell's blog

By hello_hell, history, 3 years ago, In English

Problem link: Color Play

I tried a greedy approach for this problem, here is my solution :

Spoiler

But this gave me WA. So I found a test case also:

Spoiler

answer should be 1 , but my code gives 3. I guess this is DP problem. Can anyone please help.

Full text and comments »

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

By hello_hell, history, 4 years ago, In English

I am trying to solve UVa 107 problem. It seems to be an maths oriented problem. Initially I tried to derive a few relation but they didn't seem to be helpful.

After searching for any online explaination i found this. Here if you consider first point in explaination (N/(N+1))^(M-1) = B / A, I am not able to understand how this relation is true. It would help me if anyone could explain it. Thanks.

Full text and comments »

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

By hello_hell, history, 4 years ago, In English

Problem Statement : Hotel Queries

for this problem, I implemented two solutions. The first solution by using merge sort tree with simple vector and Second is by using merge sort tree with multiset. Both of the solutions are giving me TLE for 3 test cases. Could you please share a better approach.

First Solution
Second Solution

Full text and comments »

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

By hello_hell, history, 4 years ago, In English

In this problem i sorted the activities by their ending time. With this solution i got Wrong Answer 6 times. I got so much frustrated that i implemented this brute force solution & even it gave me a wrong answer. Would you please point out my mistake.

Full text and comments »

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