
ACM


Ebony and Ivory
Dante is engaged in a fight with “The Savior”. Before he can fight it with his sword, he needs to break its shields. He has […]

A Trivial Problem
Mr. Santa asks all the great programmers of the world to solve a trivial problem. He gives them an integer m and asks for the number of […]

Spy Syndrome 2
After observing the results of Spy Syndrome, Yash realised the errors of his ways. He now believes that a super spy such as Siddhant can’t […]

Fibonacci-ish
Yash has recently learnt about the Fibonacci sequence and is very excited about it. He calls a sequence Fibonacci-ish if the sequence consists of at […]

The Chocolate Spree
Alice and Bob have a tree (undirected acyclic connected graph). There are a i chocolates waiting to be picked up in the i-th vertex of the tree. First, they […]

Startup Funding
An e-commerce startup pitches to the investors to get funding. They have been functional for n weeks now and also have a website! For each week they […]

Yash And Trees
Yash loves playing with trees and gets especially excited when they have something to do with prime numbers. On his 20th birthday he was granted […]

Fibonacci-ish II
Yash is finally tired of computing the length of the longest Fibonacci-ish sequence. He now plays around with more complex things such as Fibonacci-ish potentials. […]

XOR Equation
Two positive integers a and b have a sum of s and a bitwise XOR of x. How many possible values are there for the ordered pair (a, b)? Input The first line of the input […]

Factory Repairs
A factory produces thimbles in bulk. Typically, it can produce up to a thimbles a day. However, some of the machinery is defective, so it can currently […]


Package Delivery
Johnny drives a truck and must deliver a package from his hometown to the district center. His hometown is located at point 0 on a number line, […]

Preorder Test
For his computer science class, Jacob builds a model tree with sticks and balls containing n nodes in the shape of a tree. Jacob has spent a i minutes building […]


Table Compression
Little Petya is now fond of data compression algorithms. He has already studied gz, bz, zip algorithms and many others. Inspired by the new knowledge, Petya is now developing […]

Image Preview
Vasya’s telephone contains n photos. Photo number 1 is currently opened on the phone. It is allowed to move left and right to the adjacent photo by […]


Clockwork Bomb
My name is James diGriz, I’m the most clever robber and treasure hunter in the whole galaxy. There are books written about my adventures and […]

Voting for Photos
After celebrating the midcourse the students of one of the faculties of the Berland State University decided to conduct a vote for the best photo. […]