当前位置:网站首页>打印任务排序 js od华为
打印任务排序 js od华为
2022-07-31 01:18:00 【大鸡腿最好吃】
标题:打印任务排序 | 时间限制:1秒 | 内存限制:262144K | 语言限制:不限
某个打印机根据打印队列执行打印任务。打印任务分为九个优先级,分别用数字1~9表示,数字越大优先级越高。打印机每次从队列头部取出第一个任务A,然后检查队列余下任务中有没有比A优先级更高的任务,如果有比A优先级高的任务,则将任务A放到队列尾部,否则就执行任务A的打印。请编写一个程序,根据输入的打印队列,输出实际的打印顺序
输入描述:
输入一行,为每个任务的优先级,优先级之间用逗号隔开,优先级取值范围是1~9
输出描述:
输出一行,为每个任务的打印顺序,打印顺序从0开始,用逗号隔开
示例1
输入
9,3,5
输出
0,2,1
说明
队列头部任务的优先级为9,最先打印,故序号为0;接着队列头部任务优先级为3,队列中还有优先级为5的任务,优先级3任务被移到队列尾部;接着打印优先级为5的任务,故其序号为1;最后优先级为3的任务的序号为2
示例2
边栏推荐
- Centos 7.9 install PostgreSQL14.4 steps
- 程序员工作三年攒多少钱合适?
- MySQL (6)
- ShardingSphere之垂直分库分表实战(五)
- Xiaohei's leetcode journey: 117. Fill the next right node pointer of each node II
- The sword refers to offer17---print the n digits from 1 to the largest
- 深度学习可以求解特定函数的参数么?
- ECCV 2022 华科&ETH提出首个用于伪装实例分割的一阶段Transformer的框架OSFormer!代码已开源!
- 华为“天才少年”稚晖君又出新作,从零开始造“客制化”智能键盘
- Know what DTU is 4GDTU equipment
猜你喜欢
DOM系列之 offset 系列
ShardingSphere's vertical sub-database sub-table actual combat (5)
Mysql:Invalid default value for TIMESTAMP
JPEG Steganalysis of Digital Image Steganography
BOM系列之Navigator对象
Problem record in the use of TypeScript
Basic Parameters of RF Devices 1
ShardingSphere's public table combat (7)
仿牛客网项目总结
Huawei's "genius boy" Zhihui Jun has made a new work, creating a "customized" smart keyboard from scratch
随机推荐
调度中心xxl-Job
Jetpack Compose学习(8)——State及remeber
DOM系列之 client 系列
ShardingSphere's public table combat (7)
Mysql:Invalid default value for TIMESTAMP
射频器件的基本参数2
小黑leetcode之旅:104. 二叉树的最大深度
XSS related knowledge
响应式布局与px/em/rem的比对
The difference between 4G communication module CAT1 and CAT4
ROS Action通信
【952. 按公因数计算最大组件大小】
822. Walk the Grid
TypeScript在使用中出现的问题记录
Parameter introduction and selection points of wireless module
Why use high-defense CDN when financial, government and enterprises are attacked?
华为“天才少年”稚晖君又出新作,从零开始造“客制化”智能键盘
API 网关 APISIX 在Google Cloud T2A 和 T2D 的性能测试
Word 表格跨页,仍然显示标题
typescript18-对象类型