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

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

problem : in a rooted binary tree with n nodes, each node has a positive value( v(i) ) you need to select k(k<=n) nodes from the tree. if a node is selected you must select all of its ancestors.design a dp algo for maximum possible value of k selected nodes

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

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

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

How to solve this: given multiple query of type : x l r , we need to find the frequency of x in the range r to l. There are no updation so basically calls out for an offline algorithm .

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

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

Автор speedster, история, 9 лет назад, По-английски
  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится

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

Hello codeforces community . I was stuck in this problem was quite sometime . So decided to view the editorial . LINK . I completely understood the editorial but having a hard time understanding why it works . What is the reason behind this. I'll try to explain the method: — we will start will smallest a[i] and for each a[i] we will run a loop from ( j= 2*a[i] till 2*maximum_element_of_array with increment of a[i] (just like sieve) at each j we will find the number which is JUST less than this j present inside the array .If this number j compares greater than a[i] we will store the result in the variable ans . REFERENCE SOL Thank you . plz help me out :)

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

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

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

Hey, I want to know the thought process of dynamic programming from highly rated users. Do you always start with recursion ? how do you decide the state of dp ( biggest mystery of my life currently ) .

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

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

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

I have been trying to solve This problem unable to do it i looked at the solution but can't understand how this why is taking a factor of 2 helping ?

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

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

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

Recently my topcoder arena stopped working with the message "Unable to launch the application " I tried everything from re-installing the arena to java update to clear cache . nothing worked . Then at last i opened arena.topcoder.com but I don't know how to get my kawigiedit editor to work in it. Any idea ?

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

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

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

How can we prove this : no of unique outputs to (i*j)%k where i can be any number j and k are known is k/__gcd(k,j);

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

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

Автор speedster, 9 лет назад, По-английски

Hello , I was trying to solve O2J ladder for bipartite matching but got stuck in HERE I know this is bipartite matching but I am unable to figure out what would the vertices in set1 represent and similarly what would the vertices in set2 represent . A hint would be appreciated .

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

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