Advertisement
pshipkovenski

taskDescription

Sep 15th, 2013
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1. Problem 1 – Multiverse Communication
  2.  
  3. One day, after eating too much pizza, the master-programmers Niki, Toni and Ivo started talking about “highly-intelligent” topics – how the universe started, who created it, are there other advanced forms of life, what kind of girls are hot and so on. Suddenly they received an answer from beyond to one of the biggest mysteries for the mankind – there is more than one universe in the space-time continuum! As a matter of fact – they are infinite – a multiverse to rule them all! How cool is that, huh?
  4.  
  5. So, back to our story – somewhere in between the wormholes, dark matter and a lot of space-flying Zerg Mutalisks, there was another universe almost identical to ours. The very same day after eating too much spaghetti, Ikin, Inot and Ovi (being well trained Terran Ghosts), decided to send telepathically an encrypted numerical message to our well-known software engineers.
  6.  
  7. The sent message is made of the following digits:
  8. 0 CHU
  9. 1 TEL
  10. 2 OFT
  11. 3 IVA
  12. 4 EMY
  13. 5 VNB
  14. 6 POQ
  15. 7 ERI
  16. 8 CAD
  17. 9 K-A
  18. 10 IIA
  19. 11 YLO
  20. 12 PLA
  21.  
  22. The message is written as a sequence of digits. The last digit of the number (the most right one) has a value as shown in the above table. The next digit on the left has a value 13 times bigger than the shown in the above table, the next digit on the left has 13*13 times bigger value than the shown in the table and so on. Since our masters are too lazy after so much pizza and do not want to think (and code C# too), you task is to translate the message into its decimal representation. With your help, our heroes can fall asleep calmly, knowing other universes exist somewhere.
  23.  
  24. Input
  25. The input data consists of a single line – the message from the parallel universe.
  26. The input data will always be valid and in the described format. There is no need to check it explicitly.
  27.  
  28. Output
  29. The output data consists of a single line holding the calculated decimal representation of the given message number and should be printed at the console.
  30.  
  31. Constraints
  32. • The input number will have between 1 and 9 digits.
  33. • Allowed working time for your program: 0.1 seconds.
  34. • Allowed memory: 16 MB.
  35.  
  36. Examples
  37.  
  38. Input Output
  39. OFT 2 Explanation From the table OFT means 2 in 13th based numeral system. Message is 2. After converting it to decimal – the answer is 2.
  40.  
  41. Input Output
  42. IVAYLO 50 Explanation From the table IVA means 3 and YLO means B (11) in 13th based numeral system. Message is 3B. After converting it to decimal – the answer is 50.
  43.  
  44. Input Output
  45. TELERIK-ACADEMY 45569 Explanation From the table TEL means 1, ERI means 7, K-A means 9, CAD means 8 and EMY means 4 in 13th based numeral system. Message is 17984. After converting it to decimal – the answer is 45569.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement