ΠΔΠ-29 (2017) - Phase A (sch)

View as PDF

Submit solution

Points: 10 (partial)
Time limit: 1.0s
Memory limit: 64M

Author:
Problem types
Allowed languages
C, C++, Java, Pascal, Python

PANHELLENIC SCHOOL NETWORK

The Panhellenic School Network (PSN, www.sch.gr) is the national network and Internet service provider (ISP) of the Ministry of Education, Research, and Religious Affairs, connecting electronically more than 16.000 units nationwide. The PSN is the largest public network in the country in terms of the number of users it serves. Specifically, it serves a community of 1.300.000 students and 160.000 educators and education administration staff. Through this network, the Ministry provides communication and collaboration services to the school community, as well as electronic governance services and user support services for primary and secondary education administration. One of its oldest and most widespread services is web hosting for its users. The hosting of websites is done on dedicated servers primarily installed in University institutions. Each connected computer or network with appropriate settings selects the preferred server and two alternatives. This is particularly useful for the network administrator to configure settings so that the servers with the most visited websites are accessed directly.

Problem

Develop a program in one of the IOI languages (PASCAL, C, C++, Java) that, after reading the log file of the PSN servers' visitation, will return the incremental number^1 of the three most visited servers.

Input Files:

The input files named sch.in are text files with the following structure: They consist of exactly two lines. In the first line, there is an integer N (3 \le N \le 100.000), which corresponds to the number of records in the PSN website visitation file. The second line contains exactly N space separated integers S (1 \le S \le 10.000). These numbers represent the incremental numbers of web servers that received visits as recorded in the log file.

Output Files:

The output files named sch.out are text files with the following structure: They consist of exactly one line with three space separated numbers. These numbers represent the incremental numbers of web servers with the highest visitation as derived from the log file processing.

Examples of Input - Output Files:
1o

STDIN (sch.in)

10
1 1 1 1 2 2 3 3 3 1

STDOUT (sch.out)

1 3 2
2o

STDIN (sch.in)

20
1 1 2 2 2 3 3 3 3 4 4 4 4 4 5 5 5 5 5 5

STDOUT (sch.out)

5 4 3
3o

STDIN (sch.in)

6
42 17 8888 17 42 42

STDOUT (sch.out)

42 17 8888
Notes:
  • Assume that the input file will contain visitation data for at least three web servers.
  • Assume that the first web server in terms of visitation will have more visits than the second, the second will have more than the third, and so on, up to the fourth (if it exists).
  • Maximum execution time: 1 sec.
  • Maximum available memory: 64 MB.

  1. In reality, these servers are not identified by their incremental number but by their IPv4 address.
  2. The address for the PSN is in the following format: 194._63.23X.XXX

Comments

There are no comments at the moment.