Site Navigation
|
International Software Competition: SEARCC 96Ambassador Hotel, Bangkok, Thailand.July 6, 1996
Problem 1Prime Problem:How many prime numbers between a given non-negative integer range, n and m (including the values of n and m), in which the summation of all digits in each prime must be equal to p? Assume that 1 ≤ n ≤ 1000 , 1 ≤ m ≤ 2000, 0 ≤ p ≤ 30, and n ≤ m.
Input n m p
Output Number of prime numbers with the above condition.
Example: Input DATA 10 DATA 35 DATA 4
Output to the screen 2
Problem 2Maze Problem:Given an arbitrary map of a rectangular maze where the locations marked by x form the maze wall, and the locations marked by - represent the space. Write a program to find a shortest route between the two locations that are marked by *. Find also the number of steps of walk in the route. Each step of walk can be in rectangular direction only i.e. left, right, up or down. Use @to show the route. The data file wilt be a text file which contains only characters x, - and * (except the first line which defines the size of the maze) which describe the maze as defined above.
Example:
The input must be read from the file named test2.in, and the result must be on the screen
Input from the file test2.in": 6 9 <maze size (row col) the maximum size is 20 x 60.> ------*-- -xxxxx--- <No space between each symbol -x---x--- and there are exactly two * in the input file.> -x-*-x--- -----xx-- ---------
Output to the screen: ------@-- -xxxxx@-- -x---x@-- -x-@-x@@- ---@-xx@- ---@@@@@-
12 Step(s)
Note
Problem 3Internet Service Provider (ISP) Problem:A manager of an ISP company wants to analyze system usages from the log file to find the utilization of the system. He wants to know:
When a user wants to use the system he (or she) must log in into the system and after finishing his work he must also log out off the system. For each logging in or logging out, the system will keep track of the user activity by storing the time into the log file. The information kept in the log file consists of the following 4 fields:
The log file is presented in the DATA statement with the following format (all values are nonnegative integers): Input DATA <number of records> DATA <user id>, <record type>, <hour>, <min>
Example
Input from DATA Statement: DATA 6 DATA 1,1,10,30 DATA 2,1,40,40 DATA 1,2,10,45 DATA 3,1,11,20 DATA 3,2,11,25 DATA 2,2,9,10
Output to the screen: UserID Hour Min 1 0 15 2 22 30 3 0 5
The maximum number of users using the system simultaneously is: 2
The, maximum utilization interval is: 10:40-10:45 11:20-11:25
Note:
Problem 4Line Intersections Problem:Write a program to find the number of intersecting pairs among a set of N lines.
The input defines a set of lines by a nonnegative integer N, representing the number of lines in the set, followed by N input lines describing the lines in the set. Each line description contains four nonnegative integer x1, y1, x2 and y2, that is, a line is represented by a pair of endpoints (x1, y1) and (x2, y2).
Assuming that 0 ≤ x ≤ 20, 0 ≤ y ≤ 20, 0 ≤ N ≤ 20 and the maximum number of intersection points is 100.
Assume also that if more than two lines intersect at the exact same point, this intersecting point will be counted as one and there is no two or more lines that are overlapped.
Input: DATA 3 DATA 2, 2, 3, 8 DATA 1, 3, 8, 9 DATA 6, 9, 7, 4
Output to the screen: 2 |