12014 - DS_2018Fall_Homework1   

Description

Round-robin (RR) is a common scheduling algorithm for CPU scheduling. Each process uses CPU for a period of time.

Your goal is given n processes with their process_ids, arrival times and burst times, using RR scheduling with time quantum = 3, output the finishing order of the processes.If two or more processes go into the waiting queue at the same time, the smaller process_id first. 
Note that the <stack>, <queue>, <vector> and <list> are not allowed.

Input

Starting with a number n, then there are n lines below, and each line has three integers, process_id, arrival_time and request_time.

The bigger process_id is, the later arrives to the system.

Output

process_ids, ordered by finishing time, separated by commas.

 

you need to output '\n' in the end of line

(newline)

Sample Input  Download

Sample Output  Download

Partial Judge Code

12014.cpp

Partial Judge Header

12014.h

Tags




Discuss