Showing posts with label Volume CXV. Show all posts
Showing posts with label Volume CXV. Show all posts

Solution of 11559 - Event Planning

Problelm description
source: http://uva.onlinejudge.org/external/115/11559.html

As you didn’t show up to the yearly general meeting of the Nordic Club of Pin Collectors, you were unanimously elected to organize this years excursion to Pin City. You are free to choose from a number of weekends this autumn, and have to find a suitable hotel to stay at, preferably as cheap as possible. You have some constraints: The total cost of the trip must be within budget, of course. All participants must stay at the same hotel, to avoid last years catastrophe, where some members got lost in the city, never being seen again.


Solution of 11526 - H(n)

Problem Description
source: https://uva.onlinejudge.org/external/115/11526.html

What is the value this simple C++ function will return? 

long long H(int n){ 
    long long res = 0;
    for( int i = 1; i <= n; i=i+1 ){
        res = (res + n/i);
    } 
    return res; 
} 

image

Solution of 11577 - Letter Frequency

Problem Description
source:http://uva.onlinejudge.org/external/115/11577.html



In this problem we are interested in the frequency of letters in a given line of text. Specifi- cally, we want to know the most frequently occurring letter(s) in the text, ignoring case (to be clear, “letters” refers precisely to the 26 letters of the alphabet).

Input 

Solution of 11559 - Event Planning

Problem Description
source:https://uva.onlinejudge.org/external/115/11559.html



As you didn’t show up to the yearly general meeting of the Nordic Club of Pin Collectors, you were unanimously elected to organize this years excursion to Pin City. You are free to choose from a number of weekends this autumn, and have to find a suitable hotel to stay at, preferably as cheap as possible. You have some constraints: The total cost of the trip must be within budget, of course. All participants must stay at the same hotel, to avoid last years catastrophe, where some members got lost in the city, never being seen again.

Solution of 11547 - Automatic Answer

Problem Description
source:https://uva.onlinejudge.org/external/115/11547.html

Last month Alice nonchalantly entered her name in a draw for a Tapmaster 4000. Upon checking her mail today, she found a letter that read: 
      “Congratulations, Alice! You have won a Tapmaster 4000. To claim your prize, you must answer the following skill testing question.” 
     Alice’s initial feelings of surprised joy turned quickly to those of dismay. Her lifetime record for skill testing questions is an abysmal 3 right and 42 wrong.
    Mad Skills, the leading skill testing question development company, was hired to provide skill testing questions for this particular Tapmaster 4000 draw. They decided to create a different skill testing question to each winner so that the winners could not collaborate to answer the question.
     Can you help Alice win the Tapmaster 4000 by solving the skill testing question?

image

Solution of 11530 - SMS Typing

Problem Description
source:https://uva.onlinejudge.org/external/115/11530.html


Cell phones have become an essential part of modern life. In addition to making voice calls, cell phones can be used to send text messages, which are known as SMS for short. Unlike computer keyboards, most cell phones have limited number of keys. To accommodate all alphabets, letters are compacted into single key. Therefore, to type certain characters, a key must be repeatedly pressed until that character is shown on the display panel. 
       In this problem we are interested in finding out the number of times keys on a cell phone must be pressed to type a particular message.