Back to Browse

CONCERT TICKETS | CSES PROBLEMSET SOLUTION | PROBLEM 4

1.1K views
Apr 3, 2022
23:46

There are n concert tickets available, each with a certain price. Then, m customers arrive, one after another. Each customer announces the maximum price they are willing to pay for a ticket, and after this, they will get a ticket with the nearest possible price such that it does not exceed the maximum price. Print, for each customer, the price that they will pay for their ticket. After this, the ticket cannot be purchased again. If a customer cannot get any ticket, print −1. __________________________________________________________________ Lower Bound and Upper Bound in C++ | In depth explanation: https://youtu.be/VwQPSZIciv4 __________________________________________________________________ Chapters: 0:00 Introduction 0:50 Example 4:45 Logic Building 12:37 Code __________________________________________________________________ Problem Link: https://cses.fi/problemset/task/1091 __________________________________________________________________ Solution Link: https://github.com/Code-Disk/Sorting-and-Searching/blob/main/Concert_Tickets.cpp __________________________________________________________________

Download

0 formats

No download links available.

CONCERT TICKETS | CSES PROBLEMSET SOLUTION | PROBLEM 4 | NatokHD