当前位置:网站首页>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
边栏推荐
- "Cloud native's master, master and vulgar skills" - 2022 National New College Entrance Examination Volume I Composition
- 静态路由+PAT+静态NAT(讲解+实验)
- 真正的CTO,是一个懂产品的技术人
- The Sad History of Image Processing Technology
- The comprehensive result of the case statement, do you know it?[Verilog Advanced Tutorial]
- My first understanding of MySql, and the basic syntax of DDL and DML and DQL in sql statements
- What level of software testing does it take to get a 9K job?
- leetcode-1161: Maximum in-layer element sum
- Teach you how to configure Jenkins automated email notifications
- 12 pictures take you to fully understand service current limit, circuit breaker, downgrade, and avalanche
猜你喜欢
What does a software test report contain?
LeetCode 1161 最大层内元素和[BFS 二叉树] HERODING的LeetCode之路
系统需求多变如何设计
User interaction + formatted output
力扣刷题之爬楼梯(7/30)
AI在医疗影像设备全流程应用
12 pictures take you to fully understand service current limit, circuit breaker, downgrade, and avalanche
16. Registration Center-consul
Fiddler抓包模拟弱网络环境测试
Fiddler captures packets to simulate weak network environment testing
随机推荐
How to do a startup CTO?
Nacos
Project development software directory structure specification
Layer 2 broadcast storm (cause + judgment + solution)
Installation, start and stop of redis7 under Linux
Problems that need to be solved by the tcp framework
Face detection based on opencv
The application of AI in the whole process of medical imaging equipment
成为比开发硬气的测试人,我都经历了什么?
Path and the largest
AI software development process in medical imaging field
AtCoder Beginner Contest 261 Partial Solution
leetcode-399: division evaluation
修改未正确放入沙盒造成苹果兼容性问题
MySQL installation tutorial (detailed, package teaching package~)
Mathematical Ideas in AI
基于opencv实现人脸检测
Drools规则属性,高级语法
Software testing basic interface testing - getting started with Jmeter, you should pay attention to these things
What are the project management tools like MS Project