
New Year and Hurry
Limak is going to participate in a contest on the last day of the 2016. The contest will start at 20:00 and will last four […]
Limak is going to participate in a contest on the last day of the 2016. The contest will start at 20:00 and will last four […]
Every Codeforces user has rating, described with one integer, possibly negative or zero. Users are divided into two divisions. The first division is for users […]
In this problem we assume the Earth to be a completely round ball and its surface a perfect sphere. The length of the equator and […]
One tradition of welcoming the New Year is launching fireworks into the sky. Usually a launched firework flies vertically upward for some period of time, […]
The New Year tree is an infinite perfect binary tree rooted in the node 1. Each node v has two children: nodes indexed (2·v) and (2·v + 1). Polar bears love decorating the […]
This is an interactive problem. In the interaction section below you will find the information about flushing the output. The New Year tree of height h is […]
Alice and Bob are decorating a Christmas Tree. Alice wants only $3$ types of ornaments to be used on the Christmas Tree: yellow, blue and […]
Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point $T$, which coordinates to […]
There are $n$ people sitting in a circle, numbered from $1$ to $n$ in the order in which they are seated. That is, for all […]
Let $n$ be an integer. Consider all permutations on integers $1$ to $n$ in lexicographic order, and concatenate them into one big sequence $p$. For […]
Bob is an active user of the social network Faithbug. On this network, people are able to engage in a mutual friendship. That is, if […]
Bob is a duck. He wants to get to Alice’s nest, so that those two can duck! Duck is the ultimate animal! (Image courtesy of […]
Integer factorisation is hard. The RSA Factoring Challenge offered $$100\,000$ for factoring RSA-$1024$, a $1024$-bit long product of two prime numbers. To this date, nobody […]
Alice and Bob play a game on a grid with $n$ rows and infinitely many columns. In each row, there are three tokens, blue, white […]
A sequence $a = [a_1, a_2, \ldots, a_l]$ of length $l$ has an ascent if there exists a pair of indices $(i, j)$ such that $1 \le […]
Recall that the permutation is an array consisting of $n$ distinct integers from $1$ to $n$ in arbitrary order. For example, $[2,3,1,5,4]$ is a permutation, […]
Happy new year! The year 2020 is also known as Year Gyeongja (경자년, gyeongja-nyeon) in Korea. Where did the name come from? Let’s briefly look at the Gapja system, which […]
Filled with optimism, Hyunuk will host a conference about how great this new year will be! The conference will have $n$ lectures. Hyunuk has two […]
Kiwon’s favorite video game is now holding a new year event to motivate the users! The game is about building and defending a castle, which […]
Donghyun’s new social network service (SNS) contains $n$ users numbered $1, 2, \ldots, n$. Internally, their network is a tree graph, so there are $n-1$ direct […]