Arnab Chakraborty has Published 4452 Articles

C++ code to find different winner and non-winner counts on a contest

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Mar-2022 14:29:04

173 Views

Suppose we have two numbers n and k, There are n students in a contest. Some of them will receive memento, some will get certificates, and others won't receive anything. Who receives something are called winners. But there are some rules of counting the number of memento and certificates. The ... Read More

C++ code to count maximum banknotes bank can gather

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Mar-2022 14:23:19

179 Views

Suppose we have three numbers k, l and m, and have another array A with n elements. A robber failed to rob a bank but had managed to open all the safes of a bank. The blank client decides to take advantage of this failed robbery and steal some money ... Read More

C++ code to find winner of math contest

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Mar-2022 14:19:42

331 Views

Suppose we have two arrays P and T of size n. And have another number c. Amal and Bimal are going to participate one math contest. There are n problems. The ith problem has initial score P[i], and takes T[i] to solve it. P and T both are sorted in ... Read More

C++ code to count children who will get ball after each throw

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Mar-2022 14:16:35

1K+ Views

Suppose we have a number n. Few kids are standing on a circle. They are numbered from 1 to n, they are in clockwise order and the child number 1 is holding the ball. First the child number 1 throws the ball to the next one clockwise, Then the child ... Read More

C++ code to find minimum time needed to do all tasks

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Mar-2022 14:14:31

376 Views

Suppose we have an array A with n elements, and two other arrays k and x. The ith task takes A[i] time to complete. The given A is sorted in non-decreasing fashion. Amal takes at most k tasks and do each of them in x units of time instead of ... Read More

C++ code to count who have declined invitation

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Mar-2022 14:11:40

117 Views

Suppose we have an array A with n elements, and all elements are distinct. There are n of the onsite finalists who can join a company, their qualifying ranks are present in array A. We have to find the minimum possible number of contestants that declined the invitation to compete ... Read More

C++ code to count columns for calendar with month and first day

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Mar-2022 14:08:43

257 Views

Suppose we have two numbers m and d. Consider a calendar where week days are represented as columns and rows are current days. We want to know how many columns in the calendar should have given the month m and the weekday of the first date of that month d ... Read More

C++ code to check query for 0 sum

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Mar-2022 13:58:37

111 Views

Suppose we have an array A with n elements, the elements are in range -1 to 1. And have another array of pairs for m queries Q like Q[i] = (li, ri). The response to the query will be 1 when the elements of array a can be rearranged so ... Read More

C++ code to get maximum profit by house making

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Mar-2022 13:56:03

216 Views

Suppose we have two numbers n and h, and another array of m triplets T, where T[i] = (li, ri, xi). On a road, there are n places where we can make houses. The spots are numbered as 1 to n. The house height can be from 0 to h. ... Read More

C++ code to check given matrix is good or not

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Mar-2022 13:15:01

172 Views

Suppose we have one n x n matrix. The matrix is said to be a good matrix where every number not equal to 1 can be expressed as the sum of a number in the same row and a number in the same column. We have to check whether given ... Read More

Advertisements