OMO 2012

The numbers 1 , 2 , 3 , 4 , , 2012 1,2,3,4,\ldots,2012 are written on a blackboard. Each minute, a student goes to the blackboard,chooses two numbers x x and y y , erases them and writes a new number 2 x + 2 y 2x+2y on the blackboard. This process continues till only one number N N remains on the blackboard. Find the remainder when the maximum possible value of N N is divided by 1000 1000 .


The answer is 538.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Og Astorga Diaz
Dec 28, 2015

Let x 1 + x 2 + . . . + x 2011 + x 2012 x_{1} + x_{2} + ... + x_{2011} + x_{2012} be some permutation of the list

I deduced a greddy aproach to perform the operations and get that the maximum computation of N (I'll put a proof of this later).

N = ( i = 1 2011 2 i × x i ) + 2 2011 x 2012 N = (\sum_{i=1}^{2011} 2^{i} \times x_{i}) + 2^{2011} * x_{2012}

The permutation of the list that maximizes N N is one such that for every element x i x_{i} , x i = i x_{i} = i

So let's rewritte N as N = ( i = 1 2011 2 i × i ) + 2 2011 2012 N = (\sum_{i=1}^{2011} 2^{i} \times {i}) + 2^{2011} * 2012

Now here is a little bit of Javascript to make the computation.

(function(n, mod) {
  var pw = 1, ans = 0;

  for (var i=1; i<n; ++i) {
    pw = (pw * 2) % mod;
    ans = (ans + pw * i) % mod;
  }

  ans = (ans + pw * n) % mod;

  console.log(ans);
}).call(this, 2012, 1000);

The code bellow prints out the requested answer wich is 538 \boxed{538}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...