
Tidying Up
Smart Beaver is careful about his appearance and pays special attention to shoes so he has a huge number of pairs of shoes from the […]
Smart Beaver is careful about his appearance and pays special attention to shoes so he has a huge number of pairs of shoes from the […]
Smart Beaver recently got interested in a new word game. The point is as follows: count the number of distinct good substrings of some string s. […]
By the age of three Smart Beaver mastered all arithmetic operations and got this summer homework from the amazed teacher: You are given a sequence […]
Smart Beaver became interested in drawing. He draws suns. However, at some point, Smart Beaver realized that simply drawing suns is boring. So he decided […]
Let us call a pair of integer numbers m-perfect, if at least one number in the pair is greater than or equal to m. Thus, the pairs […]
Vasya and Petya wrote down all integers from 1 to n to play the “powers” game ( n can be quite large; however, Vasya and Petya are not confused by this […]
Yet another Armageddon is coming! This time the culprit is the Julya tribe calendar. The beavers in this tribe knew math very well. Smart Beaver, […]
— Oh my sweet Beaverette, would you fancy a walk along a wonderful woodland belt with me? — Of course, my Smart Beaver! Let us […]
The Smart Beaver has recently designed and built an innovative nanotechnologic all-purpose beaver mass shaving machine, “Beavershave 5000”. Beavershave 5000 can shave beavers by families! […]
Don’t put up with what you’re sick of! The Smart Beaver decided to escape from the campus of Beaver Science Academy (BSA). BSA is a b × b square […]
You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of […]
You’re a mikemon breeder currently in the middle of your journey to become a mikemon master. Your current obstacle is go through the infamous Biridian […]
Important: All possible tests are in the pretest, so you shouldn’t hack on this problem. So, if you passed pretests, you will also pass the […]
I have an undirected graph consisting of n nodes, numbered 1 through n. Each node has at most two incident edges. For each pair of nodes, there is […]
In a far away land, there are two cities near a river. One day, the cities decide that they have too little space and would […]
Given a string s, determine if it contains any palindrome of length exactly 100 as a subsequence. If it has any, print any one of them. If it doesn’t […]
You are given n rectangles, labeled 1 through n. The corners of rectangles have integer coordinates and their edges are parallel to the Ox and Oy axes. The rectangles may touch each […]
A number of skyscrapers have been built in a line. The number of skyscrapers was chosen uniformly at random between 2 and 314! (314 factorial, a very large number). […]