avinash007's blog

By avinash007, history, 3 years ago, In English

Recently I came across this problem from Atcoder Beginner Contest 130

Link-Zig Zag Tree

After trying very hard I was not able to understand the editorial explanation. So I request anyone who knows the problem solution to help me solve it.

Also suggest similar problems

Full text and comments »

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

By avinash007, history, 3 years ago, In English

Can someone please give a detailed solution for the below problem as I am not able to understand the editorial. Problem

Also please use dp[l][r] as the minimum operation required to achieve the task. Link to Similar Problems would be appreciated

Full text and comments »

Tags help, dp
  • Vote: I like it
  • 0
  • Vote: I do not like it

By avinash007, history, 3 years ago, In English

Find the number of pairs (i, j) such that after removing a substring S[i, j] from S, string T still remains a subsequence of S

A similar Problem Cf problem

Full text and comments »

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

By avinash007, history, 3 years ago, In English

Can Someone please explain the solution of the problem Link

I know its binary search problem but how to implement the check function

Full text and comments »

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

By avinash007, history, 4 years ago, In English

You are given N marbles in different colors. You have to remove marbles till there are no marbles left. Each time you can choose continuous marbles with the same color, remove them and get k*k points. Find the maximum points you can get.

1 ≤ N ≤ 100 0 ≤ Ai ≤ 100

INPUT 6 4 3 1 1 4 2 OUTPUT 10

Remove 1, then 3, then 4 and 2, we get 2*2+1*1+2*2+1*1 = 10

Please provide link to similar Problems.

Also I would like to know your dp states and Transitions

Full text and comments »

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