Pagini recente » Atasamentele paginii Profil RazvanM | Diferente pentru problema/sec intre reviziile 15 si 16 | Diferente pentru utilizator/ericqw intre reviziile 23 si 14 | Diferente pentru utilizator/alive intre reviziile 4 si 2 | Diferente pentru problema/winetasting intre reviziile 2 si 1
Nu exista diferente intre titluri.
Diferente intre continut:
== include(page="template/taskheader" task_id="winetasting") ==
There are $N$ vineyards arranged in a row, numbered from $0$ to $N-1$. Giorgio starts the tour from vineyard $L$, once the first tasting is over he will move on to the vineyard $L+1$, then to the vineyard $L+2$ and so on until he reaches the vineyard $R$. Note that Giorgio can start and end his tour on the same vineyard.
To visit the vineyard $i$ Giorgio has to pay $V_i$ euro. The cost of a tour is the cost of each vineyard visited.
There are a total of $N*(N+1)/2$ different tours, Giorgio will choose one of the tours in the following way:
First, he sorts the tours in ascending order of cost, in case of a tie, the tours with the smallest starting vineyard come first. Then, he chose the $K$-th tour from this order.
Help Giorgio find the first and the last vineyards of the $K$-th tour!
Poveste şi cerinţă...
h2. Date de intrare
h3. Explicaţie
In the first sample case there are $10$ possible tours, in order:
\begin{enumerate}
\item from $0$ to $0$: the cost is $1$
\item from $3$ to $3$: the cost is $1$
\item from $1$ to $1$: the cost is $2$
\item from $0$ to $1$: the cost is $1+2=3$
\item from $2$ to $2$: the cost is $3$
\item from $2$ to $3$: the cost is $3+1=4$
\item from $1$ to $2$: the cost is $2+3=5$
\item from $0$ to $2$: the cost is $1+2+3=6$
\item from $1$ to $3$: the cost is $2+3+1=6$
\item from $0$ to $3$: the cost is $1+2+3+1=7$
\end{enumerate}
The fourth tour starts from vineyard $0$ and end in vineyard $1$.
...
== include(page="template/taskfooter" task_id="winetasting") ==
Nu exista diferente intre securitate.
Topicul de forum nu a fost schimbat.