1 / 5

HKOI 2013 Junior Group

HKOI 2013 Junior Group. Queueing. Problem. Gold member 1 2345678 Ordinary member 0 1234567 Non-member 210987654321. Sample. 4 09876543 12345678 123456789012 210987654321 2 1 4 12345678 09876543 123456789012 210987654321

hadar
Download Presentation

HKOI 2013 Junior Group

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. HKOI 2013 Junior Group Queueing

  2. Problem • Gold member • 12345678 • Ordinary member • 01234567 • Non-member • 210987654321

  3. Sample 4 09876543 12345678 123456789012 210987654321 2 1 4 12345678 09876543 123456789012 210987654321 456789012345 12345678 345678901234 09876543 01234567 210987654321 12345678 456789012345 09876543 01234567 345678901234 210987654321

  4. 50% Solution • For each query, look for the Ai-th person served in O(N) • For each step, just consider the first 2 people and their number of times of ‘being stalled’, the next person gets served must be one of them

  5. 100% Solution • Precompute j-th served person, for 1<=j<=N in O(N) • O(1) for answering each query • How? • Read 50% solution again • When looking for the Ai-th served person, you know all the k-th served person, for 1<=k<=Ai

More Related