Блог пользователя hello_hell

Автор hello_hell, история, 3 года назад, По-английски

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.

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор hello_hell, история, 4 года назад, По-английски

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.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +2
  • Проголосовать: не нравится

Автор hello_hell, история, 4 года назад, По-английски

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

Полный текст и комментарии »

  • Проголосовать: нравится
  • +8
  • Проголосовать: не нравится

Автор hello_hell, история, 5 лет назад, По-английски

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.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -11
  • Проголосовать: не нравится