ameydhar's blog

By ameydhar, 11 years ago, In English

I am trying to solve this problem : 11354 — Bond

I am using minimum spanning tree but am not able to proceed after finding the minimum cost subgraph. I am not sure if my approach is correct. I would appreciate any help on the method and implementation.

Thanks.

Full text and comments »

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

By ameydhar, 11 years ago, In English

I got Wrong Answer on test #26 in the final system test on this problem : Greg and Array

I used binary indexed trees to solve the problem. Since the full test case is not visible, I am unable to find my mistake. Here is the code I submitted: Source Code

I first calculated the number of operations of each kind on the array (op[] in the code) and then used this to find the total value change in the final array (query[] in the code). I printed the result after adding the total value changes to the original array values.

Any help on what am I doing wrong or other optimizations would be highly appreciated. I am a beginner and this is the first time I used binary indexed tree in my submission during a contest.

Full text and comments »

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