当前位置:网站首页>print task sorting js od huawei
print task sorting js od huawei
2022-07-31 02:19:00 【Big chicken thighs are the best】
Title: Sort Print Tasks | Time Limit: 1 Second | Memory Limit: 262144K | Language Limit: Unlimited
A printer prints according to Queue to perform print tasks.Printing tasks are divided into nine priorities, which are represented by numbers 1 to 9. The higher the number, the higher the priority.The printer takes the first task A from the head of the queue each time, and then checks whether there are tasks with a higher priority than A in the remaining tasks in the queue. If there is a task with a higher priority than A, it puts task A at the end of the queue.Otherwise, the printing of task A is performed.Please write a program to output the actual print order according to the input print queue
Enter a description:
Enter a line for each task's priority, the priorities are separated by commas, and the priority value range is 1~9
Output description:
Output one line, the printing order of each task, the printing order starts from 0, separated by commas
Example 1
Enter
9,3,5
Output
0,2,1
Description
The priority of the task at the head of the queue is 9, and it is printed first, so the sequence number is 0; then the priority of the task at the head of the queue is 3, and there are tasks with priority 5 in the queue, and the priority 3 task is moved toAt the end of the queue; then print the task with priority 5, so its sequence number is 1; the last task with priority 3 has the sequence number 2
Example 2
边栏推荐
- Verify the integer input
- First acquaintance with C language -- array
- MySQL stored procedure
- LeetCode 1161 最大层内元素和[BFS 二叉树] HERODING的LeetCode之路
- Gateway routing configuration
- Intranet Infiltration - Privilege Escalation
- Drools basic introduction, introductory case, basic syntax
- The Sad History of Image Processing Technology
- What does a software test report contain?
- Between two orderly array of additive and Topk problem
猜你喜欢

The Sad History of Image Processing Technology

Software testing basic interface testing - getting started with Jmeter, you should pay attention to these things

To write good test cases, you must first learn test design

Installation, start and stop of redis7 under Linux

Introduction to flask series 】 【 flask - using SQLAlchemy

multiplayer-hlap 包有问题,无法升级的解决方案

uniapp uses 3rd party fonts

AI在医疗影像设备全流程应用

The principle of complete replication of virtual machines (cloud computing)

General introduction to the Unity interface
随机推荐
ShardingJDBC基本介绍
Brute Force/Adjacency Matrix Breadth First Directed Weighted Graph Undirected Weighted Graph
The effective square of the test (one question of the day 7/29)
cudaMemcpy study notes
Static routing + PAT + static NAT (explanation + experiment)
934. 最短的桥
拒绝加班,程序员开发的效率工具集
力扣刷题之爬楼梯(7/30)
Refuse to work overtime, a productivity tool set developed by programmers
Teach you how to configure Jenkins automated email notifications
The principle of complete replication of virtual machines (cloud computing)
mysql 索引
What is the ideal college life?
The final exam first year course
Project development software directory structure specification
直播预告 | KDD2022博士论文奖冠亚军对话
Crawler text data cleaning
修改未正确放入沙盒造成苹果兼容性问题
tcp框架需要解决的问题
Face detection based on opencv