-->
当前位置:首页 > 题库

PROGRAMMING:Assembly line and workstation

Luz5年前 (2021-05-10)题库486
A steam company produces steam in a factory with several assembly lines. After each assembly line enters, different parts will be installed on the chassis at each station, and the finished steam will leave from the end of the assembly line.
There are n workstations on each assembly line. The jth workstation of assembly line I is represented by s (I, J). The workstations at the same position of two assembly lines perform the same functions. However, because the workstations are built at different times and adopt different technologies, the time required for each workstation to complete the assembly is also different.
Under normal circumstances, the time taken by the chassis to move from the upper station of the same assembly line to the next station can be ignored. However, in case of emergency orders, it will also take some time to move the unfinished chassis from the upper station of the same assembly line to the next station of another assembly line, but it will also take some time to move from one assembly line to the next station of another assembly line, In addition, the time required for the chassis to enter the assembly line I is e (I), and the time required for the chassis to leave the assembly line I is x (I).
Please select the assembly line's work station for assembly, so that the total time of steam passing through is the shortest.
As shown in the figure below, the fastest time is to select stations 1, 3 and 6 of assembly line 1 and stations 2, 4 and 5 of assembly line 2, and the shortest passing time is 38.
![ Optimal solution a.jpg] (~ / 0921e6b6-adbb-4d4d-9fa3-5a6f1d2cd8bc. JPG)
###Input format:
The first line is the number of assembly lines and the number of workstations, separated by spaces.
The next lines line is the assembly time of each workstation on the assembly line.
The next lines line is the moving time from the current assembly line to the next workstation of other assembly lines. Note that the last workstation has no movement time.
The next line is the entry time E [i] of each assembly line.
The next line is the exit time x [i] of each assembly line.
###Output format:
The first line outputs the total assembly time.
Next, the assembly process is output in sequence, and the format is as follows:
Assembly line workstation
###Input example:
Here is a set of inputs. For example:
```in
2 6
7 9 3 4 8 4
8 5 6 4 5 7
2 3 1 3 4
2 1 2 2 1
2 4
3 2
```
###Output example:
The corresponding output is given here. For example:
```out
Total Time 38
1 1
2 2
1 3
2 4
2 5
1 6
```







answer:If there is no answer, please comment