Ayush Gupta has Published 541 Articles

Queries for number of distinct elements in a subarray in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 07:44:10

150 Views

In this problem, we are given an array arr[] of size n. And Q queries, each consisting of two elements l and r. Our task is to create a program to solve Queries for number of distinct elements in a subarray in C++.Problem description − Here for each querry, we ... Read More

Queries for number of distinct elements in a subarray | Set 2 in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 07:43:19

306 Views

In this problem, we are given an array arr[] of size n and we are given a query. Each query contains two values (L, R). our task is to create a program to solve queries for number of distinct elements in a subarrayProblem description − Here, we will need to ... Read More

Queries on sum of odd number digit sums of all the factors of a number in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 07:42:01

107 Views

In this program, we are given Q queries, each query has a positive integer N. Our task is to create a program to solve queries on sum of odd number digit sums of all the factors of a number in C++.Problem description − To solve each query, we need to ... Read More

Queries for number of distinct integers in Suffix in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 07:40:33

69 Views

In this problem, we are given an array of N integers. There are Q queries, each containing an integer value m. Our task to create a program to solve Queries for number of distinct integers in Suffix in C++.Problem description − Here, we will need to find the total number ... Read More

Queries on insertion of an element in a Bitonic Sequence in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 07:39:38

56 Views

In this problem, we are given a bitonic Sequence and Q queries. Each query has an integer x. Our task is to print the length of the bitonic sequence after inserting integers after each query. And at the end print the bitonic sequence.Problem description − Here, we are given a ... Read More

Queries on count of points lie inside a circle in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 07:38:06

495 Views

In this problem, we are given n points that lie of a 2D plane, each coordinate is (x, y). Our task is two solve queries. For each query, we are given an integer R. We need to find the count of points lying inside the circle, taking the circle’s center ... Read More

Queries on number of Binary sub-matrices of Given size in C++

Ayush Gupta

Ayush Gupta

Updated on 09-Sep-2020 07:35:21

83 Views

In this problem, we are given a binary matrix bin[][] of size nXm. Our task is to solve all q queries. For query(x, y), we need to find the number of submatrix of size x*x such that all the elements of array y (binary number).Problem descriptionHere, we need to count ... Read More

Queries to check if it is possible to join boxes in a circle in C++

Ayush Gupta

Ayush Gupta

Updated on 24-Aug-2020 05:37:23

72 Views

In this tutorial, we will be discussing a program to find queries to check if it is possible to join boxes in a circle.For this we will be provided with a circle of boxes running from 1 to n. Our task is to find whether box i can be connected ... Read More

Maximum value with the choice of either dividing or considering as it is in C++

Ayush Gupta

Ayush Gupta

Updated on 21-Aug-2020 05:33:51

72 Views

In this tutorial, we will be discussing a program to find maximum value with the choice of either dividing or considering as it is.For this we will be provided with an integer value. Our task is to find the maximum value with either by dividing the number into four parts ... Read More

Query for ancestor-descendant relationship in a tree in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:56:20

121 Views

In this tutorial, we will be discussing a program to find query for ancestor-descendant relationship in a tree.For this we will be provided with a rooted tree and Q queries. Our task is to find the two roots given in the query is an ancestor of the other or not.Example Live ... Read More

Advertisements