Arnab Chakraborty has Published 4293 Articles

C++ program to find at least how much score it needs to get G amount of score

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 12:24:07

306 Views

Suppose we have two arrays p and c both are with D number of elements each, and another number G. Consider in a coding contest, each problem has its score based on difficulty. The problem p[i] has score 100i. These p[1] + ... + p[D] problems are all of the ... Read More

C++ program to count maximum possible division can be made in a graph with given condition

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 12:21:17

167 Views

Suppose we have an adjacency matrix of a graph G. We have to check whether we can divide the vertices into non-empty sets V1, ... Vk, such that: every edge connects two vertices belonging to two adjacent sets. If the answer is yes, we have to find the maximum possible ... Read More

C++ Program to find maximum possible smallest time gap between two pair of clock readings

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 11:27:24

189 Views

Suppose we have an array D with N elements. Consider in a code festival there are N+1 participants including Amal. Amal checked and found that the time gap between the local times in his city and the i-th person's city was D[i] hours. The time gap between two cities: For ... Read More

C++ Program to find pairs of sequences where sequence holds minimum and maximum elements

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 11:23:37

362 Views

Suppose we have three numbers N, M and K. There are N horizontal rows and M vertical rows. We shall write an integer in between 1 and K on each cell, and define sequences A and B, such that −for each i in range 1 to N, A[i] is minimum ... Read More

C++ Program to find out if a palindromic matrix can be made from a given matrix

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 11:18:46

398 Views

Suppose, we are given a matrix with dimensions h x w. The matrix contains English letters. We have to create another matrix that will contain palindromic rows and columns, i.e. each row and column would be palindromes. To do that, any arrangement of rows and columns can be done from ... Read More

C++ Program to find out number of employees of different skill level to be transferred

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 11:13:44

258 Views

Suppose, there are n employees in a company. Each of the employees is given a rank based on their skills. The ranks are numbered from 1 to k. The number of employees having a rank i is given in the array skill, where skill[i] represents the number of employees having ... Read More

C++ Program to find out the minimum difference value in n integer pairs

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 11:09:42

262 Views

Suppose, we are given two arrays a and b that have a total of n and m values in them respectively. We have to make n or m number of pairs (whichever is minimum) using values from the two arrays. A pair must contain a value from array a and ... Read More

C++ Program to find out the sum of shortest cost paths for all given triplets

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 11:05:16

315 Views

Suppose, there are n cities and m roads between the cities. The m roads are given to us in an array of roads where the roads are in the format {aource, destination, weight}. Now, we define a triplet (s, t, k) where s, t, and k are cities. Now we ... Read More

C++ program to find out the shortest cost path in a given graph for q queries

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 11:00:37

550 Views

Suppose, we are given a graph that contains n vertices and is minimally connected. The edges are given to us an array where the edges are given in a {source, dest, weight} format. Now, we are given q number of queries where each query is of the format {source, destination}. ... Read More

C++ Program to find out the number of operations to maximize the number of even-numbered cells in a grid

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 10:56:05

154 Views

Suppose, we are given a grid of dimensions h * w. Every cell in the grid has a specific value assigned to it. We have to maximize the cells having an even value. To do that, we can select a cell that has not been selected before, and then decrease ... Read More

Advertisements