subject
Computers and Technology, 24.08.2021 02:10 bay97

A boy goes to buy video games from a shop. The shop contains N unique video games. The prices of the games are given in the form of an array A. The price of ith games is A[i]. Now the boy has q queries, in each query he wants to know the number of unique games that have a price less than the given amount M. Input: The first line contains an integer N total number of unique video games available in the shop.

The second line contains N space-separated integers (the price of the games).

The third line contains Q number of queries.

Each of the next Q lines contains integer M. Output:

For each query output number of games having price less than M for that query. Sample Input:

5
1 4 10 5 6
4
2
3
5
11
Output for the sample input:

1
1
2
5

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:40
Access defaults to searching for information on the
Answers: 1
question
Computers and Technology, 22.06.2019 02:30
The cm is responsible for overseeing the actions of the crisis management team and coordinating all crisis management efforts in cooperation with disaster recovery and/or business continuity planning, on an as-needed basis
Answers: 1
question
Computers and Technology, 22.06.2019 22:00
Consider the following declarations (1, 2, 3, 5, 7)class bagtype{public: void set(string, double, double, double, double); void print() const; string getstyle() const; double getprice() const; void get(double, double, double, double); bagtype(); bagtype(string, double, double, double, double); private: string style: double l; double w; double h; double price; }; a.) write the definition of the number function set so that private members are set according to the parametersb.) write the definition of the member function print that prints the values of the data membersc.) write the definition of the default constructor of the class bagtype so that the private member variables are initialized to "", 0.0, 0.0, 0.0, 0.0, respectively d.) write a c++ statement that prints the value of the object newbag.e.) write a c++ statement that declares the object tempbag of type bagtype, and initialize the member variables of tempbag to "backpack", 15, 8, 20 and 49.99, respectively
Answers: 3
question
Computers and Technology, 23.06.2019 05:00
In cell b18, enter a formula to calculate the amount budgeted for meals. this amount is based on the daily meal allowance and the total travel days (# of nights+1).
Answers: 1
You know the right answer?
A boy goes to buy video games from a shop. The shop contains N unique video games. The prices of the...
Questions
question
Chemistry, 18.05.2021 14:00
Questions on the website: 13722367