Problems

Sorting a Binary Array

Given a binary array that means each element of that array is either 0 or 1. Your task is to sort the array using minimum swaps. You are allowed to swap only adjacent elements.....Read More

Solve
Success: 33.33% | Time: 1s | Memory: 512MB
Three Consecutive Numbers

Given a number N. You have to find out three integers X, Y, and Z where, 1.      X = Y – 1,2.      Z = Y + 1,  and 3.      X + Y + Z = N.....Read More

Solve
Success: 39.29% | Time: 1s | Memory: 512MB
Easy Balance

Let you have N (0 < N < 101) integers, a1, a2, a3, ..., aN. Your objective is to have N equal integers by transforming some of them.You may transform each integer at most once. Transforming an integer x into another integer y costs you (x-y)2 taka.Find the minimum total cost t....Read More

Solve
Success: 26.67% | Time: 1s | Memory: 512MB
K’th Element (I)

You are given N sorted values and Q queries. Each query consists of three values, l, r, and k. Each query states that you have to find the k’th value from the given input starting from index l to index r. Note that the index of N sorted value starts from index 1.....Read More

Solve
Success: 66.67% | Time: 2s | Memory: 512MB
Selecting Guard (II)

BUBT is a famous university. It’s CSE department is very advanced because they produce good programmers nowadays. They arrange a programming contest in every semester. But this time the programmers don’t want to participate in the contest by risking their lives. That’s why Dipu sir set some stude....Read More

Solve
Success: 43.75% | Time: 1s | Memory: 512MB
Selecting Guard (I)

BUBT is a famous university. It’s CSE department is very advanced and they produce good programmers nowadays. They arrange a programming contest every semester. But this time the programmers don’t want to participate in the contest by risking their lives. That’s why Dipu sir set some students to gu....Read More

Solve
Success: 17.65% | Time: 1s | Memory: 512MB
Hardest Calculation Ever!!!

GCD stands for Greatest Common Divisor and LCM stands for Lowest Common Multiple. You are given an equation GCD(X, Y) + LCM(X, Y) = X+Y where X and Y are two integers. Now your task is to check the equation is valid or invalid....Read More

Solve
Success: 20.69% | Time: 1s | Memory: 512MB
Little Hackers

Little hackers Andrew and Beth are trying to find some secret information in a long log of the chat conversation of their friend Chris. They know that the secret part of the conversation is related to the message to his friend Dan they intercepted before. But the log is too long to search by hand. Th....Read More

Solve
Success: 40.00% | Time: 1s | Memory: 512MB
Mr. MMMH and Suborno

Mr. MMMH is a shopkeeper. He sells n types of chocolates, from 1 to n (1 <= n <= 107). She has K amount of money. She wants to buy the maximum number of types of chocolates.The cost of chocolates are,The cost of type 1 = The summation of divisors of 1 = 1.The cost of type 2 = The summatio....Read More

Solve
Success: 43.75% | Time: 5s | Memory: 512MB
Century!

Hey! Do you know?What century are we now? The answer is the 21st century!Do you know how to calculate it? If you don’t, then that’s not a problem at all! Okay, let’s explain it. The 1st century was 1-100 years.The 2nd century was 101-200 years.The 21st century is 2001-2100 years and so on. Your task ....Read More

Solve
Success: 25.00% | Time: 1s | Memory: 512MB