当前位置:网站首页>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
边栏推荐
- 怎样做好一个创业公司CTO?
- 两个有序数组间相加和的Topk问题
- PDF 拆分/合并
- mmdetection trains a model related command
- The real CTO is a technical person who understands products
- Linux下redis7的安装,启动与停止
- Static route analysis (the longest mask matching principle + active and standby routes)
- Calculate S=a+aa+…+aa…a
- MySQL installation tutorial (detailed, package teaching package~)
- CV-Model [3]: MobileNet v2
猜你喜欢
Basic introduction to ShardingJDBC
CV-Model【3】:MobileNet v2
基于FPGA的售货机
Introduction to flask series 】 【 flask - using SQLAlchemy
The Sad History of Image Processing Technology
汉诺塔问题
How to design the changing system requirements
一个无经验的大学毕业生,可以转行做软件测试吗?我的真实案例
Hanyuan Hi-Tech 8-channel HDMI integrated multi-service high-definition video optical transceiver 8-channel HDMI video + 8-channel two-way audio + 8-channel 485 data + 8-channel E1 + 32-channel teleph
最高月薪20K?平均薪资近万...在华为子公司工作是什么体验?
随机推荐
Brute Force/Adjacency Matrix Breadth First Directed Weighted Graph Undirected Weighted Graph
AI software development process in medical imaging field
软件测试缺陷报告---定义,组成,缺陷的生命周期,缺陷跟踪产后处理流程,缺陷跟踪处理流程,缺陷跟踪的目的,缺陷管理工具
uniapp使用第三方字体
MySQL installation tutorial (detailed, package teaching package~)
Brute Force/Adjacency List Breadth First Directed Weighted Graph Undirected Weighted Graph
General introduction to the Unity interface
Drools基本介绍,入门案例,基本语法
12 pictures take you to fully understand service current limit, circuit breaker, downgrade, and avalanche
What have I experienced to become a tester who is harder than development?
【银行系列第一期】中国人民银行
How to do a startup CTO?
CV-Model [3]: MobileNet v2
What are the project management tools like MS Project
Static route analysis (the longest mask matching principle + active and standby routes)
cudaMemcpy study notes
BAT卖不动「医疗云」:医院逃离、山头林立、行有行规
【AcWing 62nd Weekly Game】
二层广播风暴(产生原因+判断+解决)
STM32CUBEMX开发GD32F303(11)----ADC在DMA模式下扫描多个通道