[Huawei OD test questions] printer queue (python) 100% pass rate super detailed code comment code interpretation

[Huawei OD machine test real questions 2022&2023] real test catalog @click here @
[Huawei OD machine test real questions] signal transmission and reception & trial reading & @click here @
[Huawei OD machine real test questions] rent a car to ride the greenway & trial reading & @点here@

print documents

Time limit: 1s Space limit: 256MB Limited language: unlimited

Title description:

There are 5 printers to print files, and each printer has its own queue to be printed" Because the contents of the printed files are prioritized, the files in the queue have different priorities from 1 to 10, and the larger the number, the higher the priority. The printer will select the file with the highest priority from its queue to be printed to print. If there are two files with the same priority, the file that enters the queue first will be selected. Now please simulate the printing process of these 5 printers
.

Enter a description:

Each input contains 1 test case, and the first line of each test case gives the number of events N (0<1000). Then there are N lines, which respectively represent the events that occurred.

Guess you like

Origin blog.csdn.net/weixin_45541762/article/details/130673221