-->
当前位置:首页 > 题库 > 正文内容

PROGRAMMING:Oriol and David

Luz3年前 (2021-05-10)题库341
Oriol and David are in a square area with 16 units of side length, and their initial positions are (7,7) and (8,8), respectively. Now there are 20 groups, each group contains 20 positions, which need to be accessed by them. The positions are given in the form of coordinates (x, y). It is required to access as many points as possible within 120 seconds( X and y are positive integers, and 0 ≤ x < 16, 0 ≤ y < 16)
matters needing attention:
*For any location, one of oriol or David's arrival is regarded as a successful visit;
*Oriol and David must start to visit from the first group of locations, and must visit all 20 locations in the I group before they can start to visit the 20 locations in the I + 1 group. The access order of each location in the same group can be freely determined;
*Oriol and David do not need to return to the starting position after they finish the access to the current group position, they can start the access to the next group position immediately;
*Oriol and David can move in any direction at a speed of 2 unit length per second; During the movement, there are no obstacles.
###Input format:
The first line of input is a positive integer t (t ≤ 10), indicating the number of data groups. Next, t sets of data are given.
For each group of data, the input contains 20 groups, 1 row in each group, each row is composed of 20 coordinates, and each coordinate is composed of 2 integers x and y, representing 20 groups of 20 coordinates that oriol and David want to access; 0 ≤ x < 16, 0 ≤ y < 16 are separated by a space.
###Output format:
The first row of each group of data output is an integer n, which represents the number of location groups visited by the allocation scheme;
In the next N groups, the first row of each group contains two integers Ba and BB, which represent the number of locations visited by oriol and David in each group. The second and third rows contain two integers Ba and BB, I, which represent the serial number of locations visited by oriol and David in each group (counting from 0).
0 ≤ N ≤ 20,0 ≤ Ba ≤ 20,0 ≤ Bb ≤ 20,0 ≤ i ≤ 19。
###Input example:
```in
one
5 5 3 13 8 7 13 6 6 11 2 0 1 14 9 15 8 9 3 12 4 6 2 10 2 5 4 9 4 1 15 0 11 4 10 0 15 5 10 14
1 0 14 8 0 7 6 8 4 12 12 8 9 8 10 14 9 4 13 4 9 1 2 1 0 2 11 10 7 15 9 6 13 11 3 5 4 5 10 7
7 3 8 13 15 0 5 4 2 8 7 14 4 13 11 1 8 15 4 5 4 7 7 10 6 7 13 4 6 2 9 13 1 12 10 7 10 5 5 11
5 8 12 12 11 5 12 9 2 2 11 15 5 14 0 0 14 0 2 5 7 3 10 1 2 8 4 2 4 8 9 14 1 11 1 9 15 7 3 3
1 9 10 14 7 3 15 5 5 15 3 2 12 11 8 10 3 3 11 5 7 4 6 11 6 1 4 10 11 13 12 4 3 4 1 3 7 5 13 11
3 11 9 8 12 9 14 10 11 13 5 5 4 11 1 12 13 2 10 14 5 15 10 15 11 0 3 6 7 11 4 9 15 0 12 14 10 10 13 11
10 4 9 12 0 13 6 6 7 10 11 15 6 14 1 2 4 9 8 5 4 0 13 11 5 3 13 3 9 8 2 4 13 14 12 12 14 2 8 15
2 8 4 9 13 10 8 5 2 13 12 6 4 4 10 6 14 13 11 5 12 1 6 0 11 2 8 15 12 4 13 8 8 2 9 7 7 13 0 9
0 0 4 0 2 3 10 2 7 3 9 4 2 13 11 11 1 8 11 15 11 2 8 11 10 15 7 9 13 15 15 10 1 2 11 9 14 6 5 5
2 13 6 8 7 14 8 5 15 14 5 6 4 10 14 12 3 14 0 5 4 1 0 14 13 14 12 5 5 9 1 2 2 12 4 8 1 15 7 11
10 5 15 7 6 8 11 10 7 13 14 0 12 2 9 12 4 5 3 8 8 13 7 12 15 15 12 9 15 6 14 3 9 6 15 12 7 9 4 15
0 10 6 2 3 2 6 3 14 6 10 13 3 10 15 9 10 0 7 0 14 15 1 2 13 9 11 11 10 3 6 13 0 14 11 2 9 8 15 5
3 9 13 11 1 1 0 9 5 4 4 9 4 13 10 1 12 11 4 2 0 4 1 7 4 10 4 0 2 1 2 0 13 2 11 10 0 5 15 3
15 11 8 1 12 5 8 5 7 5 7 7 2 4 0 4 7 3 12 6 9 15 5 12 14 11 15 10 8 11 4 10 4 14 13 10 4 4 2 12
9 12 15 13 0 12 0 14 3 1 10 15 15 11 1 12 3 0 5 2 15 10 8 4 9 1 8 0 1 13 2 7 12 13 14 10 6 0 13 15
13 7 14 15 9 4 8 2 7 3 7 11 2 13 5 0 13 5 4 0 12 2 3 2 11 15 9 2 9 7 3 7 4 5 14 5 14 12 9 13
12 11 2 14 2 6 6 12 5 15 13 11 2 0 9 13 7 1 7 11 4 4 2 10 0 8 5 3 6 13 2 7 2 15 6 8 3 5 8 11
12 5 9 9 4 14 3 2 14 2 2 1 9 11 8 10 2 14 12 15 0 13 4 7 0 0 0 6 0 1 4 13 4 3 3 10 15 2 10 10
11 15 8 5 6 15 9 8 2 7 15 14 1 10 14 6 13 6 0 15 4 1 3 12 7 8 12 4 0 10 7 10 0 14 13 5 11 1 15 6
1 12 13 14 6 12 9 0 6 8 3 15 5 4 4 2 15 10 3 6 13 12 8 4 15 3 1 5 7 1 6 14 8 6 2 6 11 3 4 4
```
###Output example:
```out
two
10 10
1 2 3 4 5 6 7 8 9 0
11 12 13 14 15 16 17 18 19 10
1 19
one
0 2 3 4 5 6 7 8 9 11 12 13 14 15 16 17 18 19 10
```
Note: the sample only represents the format and has no special meaning.
###Scoring method:
This question according to the excellent degree of the scheme you give to evaluate the score.
The specific scoring rules are as follows:
*All data points in this question are the same data;
*When scoring, assume that there are x groups of data entered, then your scoring answer is the average value of your program's answers in all x groups of data;
*For example, if you visit 3, 5 and 8 points respectively for 3 groups of data, your score is 5.33333
*In particular, if any of the answers you output are illegal, your score is always 0;
*It is still legal for the output scheme to walk for more than 120 seconds, and only the part within 120 seconds is calculated when the answer is calculated;
*In the evaluation, the standard answers of the test points starting from 0 increase in turn. Only when the scoring answers exceed the standard answers, can you get the scores of the corresponding test points.
Illegal cases are as follows:
*The output format is incorrect;
*Repeatedly visit the points you have visited( But you can go through)
*Access points that do not exist.
The answers to some of the scoring criteria are as follows:
*Point 0: 20( That is, you need to visit an average of 20 points to get the score of this point.)
*Point 1: 70( Ditto)
*Point 2: 90;
*Point 7: 150< br>





answer:If there is no answer, please comment

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。