HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > Epoka Science Olympiad 2013-2015 > problem:


2014-11Gr-30. 50431 - Sultan's Game

Epoka Science Olympiad 2013-2015

Start: May.18.2013 at 10:00:00 AM
Finish: May.18.2013 at 03:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 2013-11Gr-30. 50316 - Population B...
• 2013-11Gr-40. 50317 - Student Line Up
• 2014-10Gr-10. 50424 - Area
• 2014-10Gr-20. 50417 - Fun Fair
• 2014-10Gr-30. 50418 - Student ave...
• 2014-10Gr-40. 50429 - Secret Message
• 2014-11Gr-10. 50430 - ATM
• 2014-11Gr-20. 50420 - Teachers Si...
• 2014-11Gr-30. 50431 - Sultan's ...
• 2015-09Gr-10. 50344 - Profit or Loss
• 2015-09Gr-20. 50725 - Fibonacci Se...
• 2015-09Gr-30. 50302 - Paper Sciss...
• 2015-09Gr-40. 50303 - Pattern
• 2015-10Gr-10. 50308 - IT Knowledg...
• 2015-10Gr-40. 50322 - Snake Pattern
• 2015-11Gr-10. 50304 - Number Pattern
• 2015-11Gr-20. 50305 - John's Tasks

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Halil Karimis.

Sultan's Game

Question: One day, the sultan's most trusted vizier died in battle. Sultan wants to choose a vizier from his soldiers. But it was hard choice for Sultan to select just one man from available n. So Sultan decides to prepare such a game that will help him to choose new vizier.

First of all, Sultan asks to his soldiers to take a unique number (from 1 to n). The rules of Sultan`s game is simple: he arrange soldiers by their numbers in increasing order. Then he eliminates all soldiers whom were standing in 1, 3, 5… positions. After last soldier eliminated Sultan rearrange soldiers by using same rule and starts elimination game again. Sultan`s game continues until just one soldier left. So Sultan promotes this soldier to vizier position.

Input specification
The number of soldiers (n ≤ 10.000) Soldiers' name and the unique numbers (from 1 to n) selected by those soldiers.

Output specification
Print the name of the soldier to be vizier.

 Sample Input I     Sample Input II   
 3
 Besnik 3
 Dorjan 1
 Alban 2
 8
 Jurgen 7
 Ermir 5
 Ardit 2
 Irdi 6
 Ervis 1
 Gerald 4
 Ditmir 3
 Ideal 8
 Sample Output I     Sample Output II   
 Alban
 Ideal


Для отправки решений необходимо выполнить вход.

www.contester.ru