You are not logged in. Please login at www.codechef.com to post your questions!

×

approach for BEERUS

Can anyone discuss their approach for this problem from this contest

This question is marked "community wiki".

asked 13 Jun, 11:15

sonu_628's gravatar image

3★sonu_628
3368
accept rate: 8%

edited 13 Jun, 11:16


The only catch in the problem was that (node(i) OR node(j)) + (node(i) AND node(j)) = node(i) + node(j).The rest is easy to figure out.

link

answered 13 Jun, 12:13

smartnj's gravatar image

6★smartnj
573
accept rate: 50%

Can you tell me where did you learn this property that A|B + A&B = A + B

(14 Jun, 12:48) ay23063★

From this I see that MST is a star with center in lightweight node. And weight MST = Sum{node_i} + (n-2)*node_0, node_0 - is lightweight node. Sum {node_i} - easy to get. But how to get weight of lightweight node?

link

answered 13 Jun, 19:51

batura_dima's gravatar image

4★batura_dima
1063
accept rate: 9%

2

If you have $\displaystyle\sum_{i}^{} node_i$ it should be straightforward to obtain the weights for each node. $node_i = \frac{1}{n} * \left( gohan[i] + trunks[i] - \displaystyle\sum_{i}^{} node_i\right)$. Now just loop over all nodes and obtain the maximum.

(13 Jun, 21:58) fayaz_0075★
toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×2,541
×368
×72
×5

question asked: 13 Jun, 11:15

question was seen: 257 times

last updated: 14 Jun, 12:48