Showing posts with label Uva - Sorting. Show all posts
Showing posts with label Uva - Sorting. Show all posts

Uva 10258.Contest Scoreboard

Nov 18, 2009

Problem: 10258.Contest Scoreboard

Background of the Solution:

There is a difficulty to take input. This can be solved by following code:
1. Remember, when a solution is accepted then penalty time is added .otherwise not.
2. First sort descending order according to total solved problem, if equal , then sort ascending order according to penalty time, if equal ,then sort ascending order according to team number
3. Same problem can accept twice; take only first time, other is ignored (see first input).
4. Use structure & use qsort function.
5. Initialize the data correctly.
6. The outputs of two consecutive cases will be separated by a blank line.
7. Last has no newline.....Be Careful.

Uva 10062 Tell me the frequencies!

Nov 17, 2009

Problem: 10062.Tell me the frequencies!
Tics:
1. Declear a structure like: struct arra{ int ascii,int fre} a[128];
2. Store a[m].ascii=m and a[m].fre++
3. Sort frequency wise and if both fre. Are equal the first large ascii
4. Loop is continue from 32 to 127
5. Print newline exactly. No etra new line at the end of the output.