Bonus2

Bonus2 - Bonus 2 Jumping the Queue Value 3 Point Time Limit 1 Second Memory Limit 32768 KB The beginning of a winter break near Spring Festival is

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Bonus 2: Jumping the Queue Value: 3 Point Time Limit: 1 Second Memory Limit: 32768 KB The beginning of a winter break near Spring Festival is always the beginning of a peak period of transportation. If you have ever tried to get a train ticket at that time, you must have witnessed the endless queues in front of every ticket box window. If a guy has seen his friend in a queue, then it is very much likely that this lucky guy might go straight to his friend and ask for a favor. This is called "jumping the queue". It is unfair to the rest of the people in the line, but, it is life. Your task is to write a program that simulates such a queue with people jumping in every now and then, assume that, if one in the queue has several friends asking for favors, he would arrange their requests in a queue of his own. Input Specification: Your program must read test cases from a file “ input.txt ”. The input file will contain one or more test cases. Each test case begins with the number of groups
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/23/2012 for the course CS 130a taught by Professor Staff during the Spring '08 term at UCSB.

Page1 / 3

Bonus2 - Bonus 2 Jumping the Queue Value 3 Point Time Limit 1 Second Memory Limit 32768 KB The beginning of a winter break near Spring Festival is

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online