bclassrank7's blog

By bclassrank7, history, 5 years ago, In English

Does anybody know if there will be Facebook Hackercup this year. Previous year it was announced till this time of January.

Full text and comments »

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

By bclassrank7, history, 5 years ago, In English

This is the Div1-250 level problem of SRM-683 :- There are n piles of stones arranged around a circle. The piles are numbered 0 through n-1, in order. In other words: For each valid i, piles i and i+1 are adjacent. Piles 0 and n-1 are also adjacent. You are given two vector s a and b, each with n elements. For each i, a[i] is the current number of stones in pile i, and b[i] is the desired number of stones for this pile. You want to move some stones to create the desired configuration. In each step you can take any single stone from any pile and move the stone to any adjacent pile. Find and return the smallest number of steps needed to create the desired configuration, or -1 if the desired distribution of stones cannot be reached.

In the editorial of the problem it is mentioned — "The solution to this cyclic version comes upon realizing that the stones don't need to move between more than n stacks, the moves in such a situation would be redundant. So there will be two adjacent stacks that don't need to share stones at all. Those two stacks can be used as the start and the end stacks of a solution like the division 2 version. "

My doubt is that how do we proof that in case of minimum moves, there will exist two adjacent piles such that no transfer of stones happens across their partition.

Thanks in advance :)

Full text and comments »

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

By bclassrank7, history, 5 years ago, In English

Hello everyone,

Is somebody else also facing issues with running codeforces on mozilla firefox. Even after scheduled maintenance, it is not working properly, there is a huge margin problem(everything has shifted left), and there is no navigation bar visible.

Thanks

Full text and comments »

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