Ayush Gupta has Published 530 Articles

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

Ayush Gupta

Ayush Gupta

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

118 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

111 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

108 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

161 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

Find three integers less than or equal to N such that their LCM is maximum in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:54:33

112 Views

In this tutorial, we will be discussing a program to find three integers less than or equal to N such that their LCM is maximum.For this we will be provided with an integer value. Our task is to find other three integers smaller than the given value such that their ... Read More

Queries to return the absolute difference between Lth smallest number and the R-th smallest number in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:53:41

137 Views

In this tutorial, we will be discussing a program to find queries to return the absolute difference between L-th smallest number and the R-th smallest number.For this we will be provided with an array containing integers and Q queries. Our task is to find the absolute difference between the indices ... Read More

Querying the number of distinct colors in a subtree of a colored tree using BIT in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:51:40

185 Views

In this tutorial, we will be discussing a program to find querying the number of distinct colors in a subtree of a colored tree using BIT.For this we will be provided with rooted tree where each node has a color denoted by given array. Our task is to find all ... Read More

Queries to update a given index and find gcd in range in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:48:16

127 Views

In this tutorial, we will be discussing a program to find queries to update a given index and find gcd in range.For this we will be provided with an array containing integers and Q queries. Our task is to find the result of given queries (updating a given value by ... Read More

Find time taken for signal to reach all positions in a string in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:44:25

96 Views

In this tutorial, we will be discussing a program to find time taken for signal to reach all positions in a stringFor this we will be provided with a string containing ‘x’ and ‘o’. A signal originates from ‘x’ and travels in both directions changing one ‘o’ value in one ... Read More

Find two numbers with sum and product both same as N in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:42:22

168 Views

In this tutorial, we will be discussing a program to find two numbers with sum and product both same as N.For this we will be provided with an integer value. Our task is to find two other integer values whose product and sum is equal to the given value.Example Live Demo#include ... Read More

Advertisements