El grupo de Programación Competitiva Pu++ esta formado por alumnos de varias licenciaturas de la F. Ciencias (Abierto a la Comunidad de CU) con el principal objetivo de participar en concursos ACM.
En este blog se encuentra algo de Teoria y Problemas con los que anteriormente hemos trabajado.
que saben acerca del uso de la libreria iostream?
del hecho de que deba ponerse.h o no para declarla?
que se deba poner usingnamespace std; o std:: antes de cada objeto o funcion? Yo intente usar << de cout, sin poner using namespace std; y no lo compilaba bien codeblocks
In a long street the traffic of express taxies is
organized in the following way: There is a taxi stop every one
kilometer. An express taxi drives along the street from each stop 1, 2,
3, ... or 10 kilometers without a stop.
For each of the ten distances a separate price is fixed and marked in
the table, e.g.
1 12
2 21
3 31
4 40
5 49
6 58
7 69
8 79
9 90
10 101
A passenger wants to travel n (1 <= n <= 100) kilometers. Can you
write a program to helping on that.
Which driving distances does the passenger have to choose so that the
journey would be the cheapest, and what is the total price of the
journey.
Especificación de entrada
The input has two lines. The first line contains ten
space separated integer numbers which are prices for driving 1, 2, 3,
... , 10 kilometers.
The last line contains the number of kilometers (n) which the passenger
has to travel.
Especificación de salida
Each line except the last one should contain two
numbers which are the length of the route and the price of the ticket.
The total price of the journey should be written in the last line of the
output. If several solutions are possible, choose one of them where
tickets (in ascending ordered by the distance) are minimum.