SAMPLES | DAY 1 | DAY 2 |
Sample Tasks for Practice
You are to write a program, which, given N positive integer values X1, X2,. . ., XN, computes the smallest number Xi that appears in the sequence at least as many times as any other number.
The output file name is numbers.out. The the first line is to contain one integer, the smallest number to appear at least as many times as any other number.
EXAMPLE INPUTS AND OUTPUTS
In all inputs, 2 ≤ N ≤ 1000, and for each Xi , 1 ≤ Xi ≤ 10000.
If your program outputs the correct answer for a test case within the time limit, then you get full points for that test case, and otherwise you get 0 points for that case.
2. Olympic Avenues
In Athens 2004 Olympic Games there were many Olympic sites (Stadiums, Olympic Village, Press Center, Offices, etc.). For the athletes, officials and press people to move fast between Olympic sites, Athens created what were called "Olympic Avenues" where only Olympic buses could move. Each Olympic avenue connects two Olympic sites. Not all Olympic sites are connected directly by an Olympic avenue. Each Olympic avenue connects exactly two Olympic sites. A bus driver is traveling from one Olympic site to another and she wants to travel only on the Olympic Avenues. Given the information about the Olympic sites and avenues, you are to help her to find a shortest route between two Olympic sites using only Olympic avenues.
You are given 4 problem instances in the text files named olympic1.in to olympic4.in. Each input file is organized as follows. The first line contains one integer: the number of Olympic sites, N, 5 ≤ N ≤ 50. Line 2 contains two integers S and F: the numbers of the starting and the ending sites of the route. The next line contains one integer L: the number of Olympic avenues. The following L lines describe these Olympic avenues. Each of these lines contain three integers I, J, and D: the first two are the Olympic sites I and J that are connected by the avenue and the third integer D is the distance between I and J. This way, the input is organized in the following form:
I1 J1 D1
I2 J2 D2
. . .
IL JL DL
You are to submit 4 output files corresponding to the given input files. You do not need to submit your solution program source. The first line is to contain the text #FILE olympic I where integer I is the number of the respective input file. The second line is to contain one integer: the length of the shortest route from S to F. The third line is to contain a sequence of integers: the numbers of the Olympic sites visited on the shortest route, where S is the first integer in the sequence and F is the last integer in the sequence.
EXAMPLE INPUTS AND OUTPUTS
If the distance in your answer corresponds to the tour in your answer, and the tour is as short as possible, you get a full score for that file. Otherwise your score is zero for that file.