Selecting DreamSpark Yatra VolunteersProblem code: DSPCXI05 |
All submissions for this problem are available.
The DreamSpark Yatra is Microsoft India's initiative at driving wide-spread enthusiasm for, and awareness of the latest innovations and technology. Thousands of students across the country get to experience the latest in technology, sparking, we hope, ideas and innovation. It is also a forum that helps them decide what their career path could be.
DreamSpark Yatra is being carried out in 100 cities in a period of 100 days. Every MSP is trying to a host a DreamSpark Yatra in his city. To conduct a DSY MSPs need volunteers who’ll help in organizing the Sessions. Being Techno-geeks MSPs have decided to select the volunteer in an interesting way. At first all the interested volunteers will register their names with the respective MSPs. Then, the MSPs will use the following algorithm to select the team:
For every given name apply an StudentHashing() Function. The StudentHashing() Function produces an integer value. As a result a series of integers is obtained corresponding to each name. The selected group of students will be a contiguous sub-group which has the maximum total value for the StudentHashing() Function.
The MSPHashing() Function is defined as – (((Sum of ASCII values of all characters) % 500)-250). You need to write a program that any MSP can use it to select the volunteers randomly.
Problem Setter: Vishal Gupta
Input:
Input consists of a and integer ‘m’ (1<=m<=1000) – the number of interested candidates, followed by names of the candidates(separated by space) in new line. Each name can have a maximum of 50 characters.
Ouput:
Print the number of selected candidates ‘n’ (>=0) in the group and the value of sum. This should be followed by the list of selected students in a new line. If more than two sub-groups are obtained with the same number of students and same sum value then print the list which comes first in the lexicographical order. Print 'Invalid' for any invalid entry.
Sample Input: 7 Ayush Azhar Shahzor Zeeshan Amritesh Kaustubh Akhil 20 Ayush Azhar Shahzor Zeeshan Amritesh Arjun Souptik Shahbaz Shradha Kaustubh Akhil Prakhar Himanshu Vishal Abhinav Vishesh Sujeet Kunal Jayesh Kapil Sample Output: 3 407 Amritesh Kaustubh Akhil 4 370 Kaustubh Akhil Prakhar Himanshu
| Author: | ganesha |
| Date Added: | 23-02-2011 |
| Time Limit: | 1 sec |
| Source Limit: | 50000 Bytes |
| Languages: | ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.0.0-8, CPP 4.3.2, CS2, D, ERL, F#, FORT, GO, HASK, ICK, ICON, JAR, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC |
Comments
SUCCESSFUL SUBMISSIONS FOR THIS PROBLEM:
HELP
Program should read from standard input and write to standard output. After you submit a solution you can see your results by clicking on the [My Submissions] tab on the problem page. Below are the possible results:
- Accepted
Your program ran successfully and gave a correct answer. If there is a score for the problem, this will be displayed in parenthesis next to the checkmark. - Time Limit Exceeded
Your program was compiled successfully, but it didn't stop before time limit. Try optimizing your approach. - Wrong Answer
Your program compiled and ran succesfully but the output did not match the expected output. - Runtime Error
Your code compiled and ran but encountered an error. The most common reasons are using too much memory or dividing by zero. For the specific error codes see the help section. - Compilation Error
Your code was unable to compile. When you see this icon, click on it for more information.
If you are still having problems, see a sample solution here.

Fetching successful submissions
