Ley Safco

Páginas: 8 (1865 palabras) Publicado: 29 de mayo de 2012
Problem C
A mid-summer night’s dream
Input: standard input
Output: standard output
 
This is year 2200AD. Science has progressed a lot in two hundred years. Two hundred years is mentioned here because this problem is being sent back to 2000AD with the help of time machine. Now it is possible to establish direct connection between man and computer CPU. People can watch other people’s dreamon 3D displayer (That is the monitor today) as if they were watching a movie. One problem in this century is that people have become so dependent on computers that their analytical ability is approaching zero. Computers can now read problems and solve them automatically. But they can solve only difficult problems. There are no easy problems now. Our chief scientist is in great trouble as he hasforgotten the number of his combination lock. For security reasons computers today cannot solve combination lock related problems. In a mid-summer night the scientist has a dream where he sees a lot of unsigned integer numbers flying around. He records them with the help of his computer, Then he has a clue that if the numbers are (X1, X2, … , Xn) he will have to find an integer number A (This A isthe combination lock code) such that

(|X1-A| + |X2-A| + … … + |Xn-A|) is minimum.
 
Input
Input will contain several blocks. Each block will start with a number n (0<n<=1000000) indicating how many numbers he saw in the dream. Next there will be n numbers. All the numbers will be less than 65536. The input will be terminated by end of file.
 
Output
Foreach set of input there will be one line of output. That line will contain the minimum possible value for A. Next it will contain how many numbers are there in the input that satisfy the property of A (The summation of absolute deviation from A is minimum). And finally you have to print how many possible different integer values are there for A (these values need not be present in the input). Thesenumbers will be separated by single space.
 
Sample Input:
2
10
10
4
1
2
2
4
Sample Output:
10 2 1
2 2 1
____________________________________________________________
Problema C

Una noche de mediados de verano el sueño de

Entrada: entrada estándar

Salida: salida estándar

 

Se trata de 2200AD año. La ciencia ha progresado mucho en 200 años. Doscientos años quese menciona aquí porque este problema está siendo enviado de vuelta a 2000AD con la ayuda de la máquina del tiempo. Ahora es posible establecer una conexión directa entre el hombre y la CPU de la computadora. La gente puede ver el sueño de otras personas en el visualizador en 3D (que es el monitor de hoy) como si estuvieran viendo una película. Uno de los problemas en este siglo es que la gente sehan vuelto tan dependientes de los ordenadores que su capacidad de análisis se aproxima a cero. Actualmente, las computadoras pueden leer los problemas y resolverlos de forma automática. Pero que pueden resolver sólo los problemas difíciles. No hay ningún problema fácil ahora. Nuestro jefe científico está en un gran problema ya que ha olvidado el número de su cerradura de combinación. Por razonesde seguridad los ordenadores actuales no pueden resolver los problemas relacionados con cerradura de combinación. En una noche de mediados de verano, el científico tiene un sueño donde ve a un montón de números enteros sin signo que vuelan alrededor. Él los registros con la ayuda de su equipo, entonces no tiene ni idea de que si los números son (X1, X2, ..., Xn) va a tener que encontrar un númeroentero A (Este es el código de una cerradura de combinación) de tal manera que

              

             (| X1-A | + | X2-A | + ... ... + | Xn-A |) es mínimo.

 

Entrada

De entrada contendrá varias cuadras. Cada bloque se iniciará con un número n (0 <n <= 1000000), indicando la cantidad de números que vio en el sueño. A continuación habrá un número n. Todos los números...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Ley Safco
  • Ley safco
  • ley safco
  • La ley safco
  • Ley Safco
  • ley safco
  • Ley Safco
  • Ley Safco

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS