Master_coder's blog

By Master_coder, history, 6 years ago, In English

I used exchange argument to find sorting criteria . then applying knapsack to find which shoud i take . question

my code
i am getting RE can any one help me ?

Full text and comments »

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

By Master_coder, history, 6 years ago, In English

Given N keys and values , and q queries for each query you have given key you have to find key smaller than given key with maximun value . for example:- keys — 2 3 1 6 4 values — 5 1 6 2 8 given key 5 must produce output 8 i.e (4,8)

Full text and comments »

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

By Master_coder, history, 6 years ago, In English

can any one explain how persistent tries work and provide implementation of it ? it's hard to find good explanation of persistent tries

Full text and comments »

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

By Master_coder, history, 6 years ago, In English

i recently solving this problem the problem is quite interesting can somebody suggest any method to solve this question if range of k increase from 200 to n .

Full text and comments »

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

By Master_coder, history, 6 years ago, In English

i am trying to solve the problem https://www.hackerrank.com/challenges/tree-pruning/problem . the main point here is how to choice which subtree we have to delete and how dfs order to visit the node can help us ?

Full text and comments »

Tags dp, tree
  • Vote: I like it
  • -20
  • Vote: I do not like it

By Master_coder, history, 6 years ago, In English

i want to know how to optimize classic 0/1 knapsack to 0/k knapsack . the problem link is https://open.kattis.com/problems/thief

Full text and comments »

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

By Master_coder, history, 6 years ago, In English

i am trying to do these question with binary search but it pass only few cases . my soln is http://codeforces.me/contest/604/submission/44016513

Full text and comments »

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

By Master_coder, history, 7 years ago, In English

how to do this problem with segment tree data structure. https://www.codechef.com/SEPT17/problems/SEACO

Full text and comments »

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