question large_stringlengths 265 13.2k |
|---|
Solve the programming task below in a Python markdown code block.
Vampire
Mr. C is a vampire. If he is exposed to the sunlight directly, he turns into ash. Nevertheless, last night, he attended to the meeting of Immortal and Corpse Programmers Circle, and he has to go home in the near dawn. Fortunately, there are man... |
Solve the programming task below in a Python markdown code block.
There is a one-dimensional cellular automaton consisting of N cells. Cells are numbered from 0 to N β 1.
Each cell has a state represented as a non-negative integer less than M. The states of cells evolve through discrete time steps. We denote the stat... |
Solve the programming task below in a Python markdown code block.
Problem
"Ritsumeikan University Competitive Programming Camp" will be held this year as well. I am very much looking forward to this annual training camp. However, I couldn't stand my desires and splurged before the training camp, so I couldn't afford ... |
Solve the programming task below in a Python markdown code block.
quiz
You are the director of a quiz show. N people will appear in the quiz show as answerers, each numbered from 1 to N.
Questions will be M + 1 questions, and each question is numbered from 1 to M + 1. Questions are given in numerical order, and poin... |
Solve the programming task below in a Python markdown code block.
D: Is greed the best?
story
In Japan, where there are 1, 5, 10, 50, 100, 500 yen coins, it is known that the number of coins can be minimized by using as many coins as possible when paying a certain amount. ..
If the amount of coins is different from... |
Solve the programming task below in a Python markdown code block.
$N$ persons visited a restaurant. The restaurant is open from 0 to $T$. The $i$-th person entered the restaurant at $l_i$ and left at $r_i$. Find the maximum number of persons during the business hours.
Constraints
* $ 1 \leq N \leq 10^5 $
* $ 1 \leq ... |
Solve the programming task below in a Python markdown code block.
After learning a lot about space exploration, a little girl named Ana wants to change the subject.
Ana is a girl who loves palindromes (string that can be read the same backwards as forward). She has learned how to check for a given string whether it's... |
Solve the programming task below in a Python markdown code block.
Ivan wants to play a game with you. He picked some string s of length n consisting only of lowercase Latin letters.
You don't know this string. Ivan has informed you about all its improper prefixes and suffixes (i.e. prefixes and suffixes of lengths f... |
Solve the programming task below in a Python markdown code block.
We all know that a superhero can transform to certain other superheroes. But not all Superheroes can transform to any other superhero. A superhero with name s can transform to another superhero with name t if s can be made equal to t by changing any vow... |
Solve the programming task below in a Python markdown code block.
Let s be some string consisting of symbols "0" or "1". Let's call a string t a substring of string s, if there exists such number 1 β€ l β€ |s| - |t| + 1 that t = s_l s_{l+1} β¦ s_{l + |t| - 1}. Let's call a substring t of string s unique, if there exist o... |
Solve the programming task below in a Python markdown code block.
Misha was interested in water delivery from childhood. That's why his mother sent him to the annual Innovative Olympiad in Irrigation (IOI). Pupils from all Berland compete there demonstrating their skills in watering. It is extremely expensive to host ... |
Solve the programming task below in a Python markdown code block.
Yet another education system reform has been carried out in Berland recently. The innovations are as follows:
An academic year now consists of n days. Each day pupils study exactly one of m subjects, besides, each subject is studied for no more than on... |
Solve the programming task below in a Python markdown code block.
You play your favourite game yet another time. You chose the character you didn't play before. It has str points of strength and int points of intelligence. Also, at start, the character has exp free experience points you can invest either in strength o... |
Solve the programming task below in a Python markdown code block.
This problem is split into two tasks. In this task, you are required to find the minimum possible answer. In the task Village (Maximum) you are required to find the maximum possible answer. Each task is worth 50 points.
There are N houses in a certain ... |
Solve the programming task below in a Python markdown code block.
You are given m sets of integers A_1, A_2, β¦, A_m; elements of these sets are integers between 1 and n, inclusive.
There are two arrays of positive integers a_1, a_2, β¦, a_m and b_1, b_2, β¦, b_n.
In one operation you can delete an element j from the ... |
Solve the programming task below in a Python markdown code block.
You are given a string s, consisting of brackets of two types: '(', ')', '[' and ']'.
A string is called a regular bracket sequence (RBS) if it's of one of the following types:
* empty string;
* '(' + RBS + ')';
* '[' + RBS + ']';
* RBS + ... |
Solve the programming task below in a Python markdown code block.
You are given two integers n and k.
You should create an array of n positive integers a_1, a_2, ..., a_n such that the sum (a_1 + a_2 + ... + a_n) is divisible by k and maximum element in a is minimum possible.
What is the minimum possible maximum ele... |
Solve the programming task below in a Python markdown code block.
You are given an integer x. Can you make x by summing up some number of 11, 111, 1111, 11111, β¦? (You can use any number among them any number of times).
For instance,
* 33=11+11+11
* 144=111+11+11+11
Input
The first line of input contains a ... |
Solve the programming task below in a Python markdown code block.
Theatre Square in the capital city of Berland has a rectangular shape with the size n Γ m meters. On the occasion of the city's anniversary, a decision was taken to pave the Square with square granite flagstones. Each flagstone is of the size a Γ a.
Wh... |
Solve the programming task below in a Python markdown code block.
You've got an array a, consisting of n integers: a1, a2, ..., an. Your task is to find a minimal by inclusion segment [l, r] (1 β€ l β€ r β€ n) such, that among numbers al, al + 1, ..., ar there are exactly k distinct numbers.
Segment [l, r] (1 β€ l β€ r β€ ... |
Solve the programming task below in a Python markdown code block.
Dima's got a staircase that consists of n stairs. The first stair is at height a1, the second one is at a2, the last one is at an (1 β€ a1 β€ a2 β€ ... β€ an).
Dima decided to play with the staircase, so he is throwing rectangular boxes at the staircase f... |
Solve the programming task below in a Python markdown code block.
Greg has an array a = a1, a2, ..., an and m operations. Each operation looks as: li, ri, di, (1 β€ li β€ ri β€ n). To apply operation i to the array means to increase all array elements with numbers li, li + 1, ..., ri by value di.
Greg wrote down k queri... |
Solve the programming task below in a Python markdown code block.
Mad scientist Mike entertains himself by arranging rows of dominoes. He doesn't need dominoes, though: he uses rectangular magnets instead. Each magnet has two poles, positive (a "plus") and negative (a "minus"). If two magnets are put together at a clo... |
Solve the programming task below in a Python markdown code block.
Let's call an array consisting of n integer numbers a1, a2, ..., an, beautiful if it has the following property:
* consider all pairs of numbers x, y (x β y), such that number x occurs in the array a and number y occurs in the array a;
* for each ... |
Solve the programming task below in a Python markdown code block.
You have probably registered on Internet sites many times. And each time you should enter your invented password. Usually the registration form automatically checks the password's crypt resistance. If the user's password isn't complex enough, a message ... |
Solve the programming task below in a Python markdown code block.
Little Dima misbehaved during a math lesson a lot and the nasty teacher Mr. Pickles gave him the following problem as a punishment.
Find all integer solutions x (0 < x < 109) of the equation:
x = bΒ·s(x)a + c,
where a, b, c are some predetermined co... |
Solve the programming task below in a Python markdown code block.
Let's denote as <image> the number of bits set ('1' bits) in the binary representation of the non-negative integer x.
You are given multiple queries consisting of pairs of integers l and r. For each query, find the x, such that l β€ x β€ r, and <image> i... |
Solve the programming task below in a Python markdown code block.
Pasha loves his phone and also putting his hair up... But the hair is now irrelevant.
Pasha has installed a new game to his phone. The goal of the game is following. There is a rectangular field consisting of n row with m pixels in each row. Initially,... |
Solve the programming task below in a Python markdown code block.
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most ai milliliters of water.
It turned ou... |
Solve the programming task below in a Python markdown code block.
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 contains two integers s and x (2 β€ s β€ 1012, 0 β€ x β€ 1012), the sum and bitwise xor... |
Solve the programming task below in a Python markdown code block.
Friends are going to play console. They have two joysticks and only one charger for them. Initially first joystick is charged at a1 percent and second one is charged at a2 percent. You can connect charger to a joystick only at the beginning of each minu... |
Solve the programming task below in a Python markdown code block.
Anton and Dasha like to play different games during breaks on checkered paper. By the 11th grade they managed to play all the games of this type and asked Vova the programmer to come up with a new game. Vova suggested to them to play a game under the co... |
Solve the programming task below in a Python markdown code block.
Recently Adaltik discovered japanese crosswords. Japanese crossword is a picture, represented as a table sized a Γ b squares, and each square is colored white or black. There are integers to the left of the rows and to the top of the columns, encrypting... |
Solve the programming task below in a Python markdown code block.
Just to remind, girls in Arpa's land are really nice.
Mehrdad wants to invite some Hoses to the palace for a dancing party. Each Hos has some weight wi and some beauty bi. Also each Hos may have some friends. Hoses are divided in some friendship groups... |
Solve the programming task below in a Python markdown code block.
While Mahmoud and Ehab were practicing for IOI, they found a problem which name was Longest common subsequence. They solved it, and then Ehab challenged Mahmoud with another problem.
Given two strings a and b, find the length of their longest uncommon ... |
Solve the programming task below in a Python markdown code block.
Sasha and Kolya decided to get drunk with Coke, again. This time they have k types of Coke. i-th type is characterised by its carbon dioxide concentration <image>. Today, on the party in honour of Sergiy of Vancouver they decided to prepare a glass of C... |
Solve the programming task below in a Python markdown code block.
Summer holidays! Someone is going on trips, someone is visiting grandparents, but someone is trying to get a part-time job. This summer Noora decided that she wants to earn some money, and took a job in a shop as an assistant.
Shop, where Noora is work... |
Solve the programming task below in a Python markdown code block.
Valentin participates in a show called "Shockers". The rules are quite easy: jury selects one letter which Valentin doesn't know. He should make a small speech, but every time he pronounces a word that contains the selected letter, he receives an electr... |
Solve the programming task below in a Python markdown code block.
A camera you have accidentally left in a desert has taken an interesting photo. The photo has a resolution of n pixels width, and each column of this photo is all white or all black. Thus, we can represent the photo as a sequence of n zeros and ones, wh... |
Solve the programming task below in a Python markdown code block.
After waking up at hh:mm, Andrew realised that he had forgotten to feed his only cat for yet another time (guess why there's only one cat). The cat's current hunger level is H points, moreover each minute without food increases his hunger by D points.
... |
Solve the programming task below in a Python markdown code block.
Ramesses knows a lot about problems involving trees (undirected connected graphs without cycles)!
He created a new useful tree decomposition, but he does not know how to construct it, so he asked you for help!
The decomposition is the splitting the ed... |
Solve the programming task below in a Python markdown code block.
Little Arjit is the leader of a marvellous fighting army. His team is very good at fighting against all their enemies. But like Hound from Game of Thrones, Little Arjit and his entire team is scared of fire. When they see fire, they feel threatened, and... |
Solve the programming task below in a Python markdown code block.
You are given N sticks, the length of the i^th stick being ai . As your professor is very interested in triangles he gives you a problem:
From the N given sticks, choose 3 sticks that form a triangle. If there are many such triangles , choose the sticks... |
Solve the programming task below in a Python markdown code block.
You have a part to play in the Wars to Come.
As everyone knows, Lord Stannis Baratheon (First of His Name, King of the Andals and the First Men, Lord of the Seven Kingdoms and Protector of the Realm) is one true king. Now, he wants to conquer the North... |
Solve the programming task below in a Python markdown code block.
Constraints
* All values in input are integers.
* 1\leq N, M\leq 12
* 1\leq X\leq 10^5
* 1\leq C_i \leq 10^5
* 0\leq A_{i, j} \leq 10^5
Input
Input is given from Standard Input in the following format:
N M X
C_1 A_{1,1} A_{1,2} \cdots A_{1,M}
C_2 A... |
Solve the programming task below in a Python markdown code block.
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
Constraints
* 1 \leq K \leq 100
* 1 \leq X \leq 10^5
Input
Input is given from Standard Input in the following... |
Solve the programming task below in a Python markdown code block.
You are given N integers; the i-th of them is A_i. Find the maximum possible sum of the absolute differences between the adjacent elements after arranging these integers in a row in any order you like.
Constraints
* 2 \leq N \leq 10^5
* 1 \leq A_i \le... |
Solve the programming task below in a Python markdown code block.
There are a total of A + B cats and dogs. Among them, A are known to be cats, but the remaining B are not known to be either cats or dogs.
Determine if it is possible that there are exactly X cats among these A + B animals.
Constraints
* 1 \leq A \le... |
Solve the programming task below in a Python markdown code block.
You are given a string S consisting of lowercase English letters. Determine whether all the characters in S are different.
Constraints
* 2 β€ |S| β€ 26, where |S| denotes the length of S.
* S consists of lowercase English letters.
Input
Input is given... |
Solve the programming task below in a Python markdown code block.
There is an image with a height of H pixels and a width of W pixels. Each of the pixels is represented by either `.` or `*`. The character representing the pixel at the i-th row from the top and the j-th column from the left, is denoted by C_{i,j}.
Ext... |
Solve the programming task below in a Python markdown code block.
There is a magic room in a homestead. The room is paved with H Γ W tiles. There are five different tiles:
* Tile with a east-pointing arrow
* Tile with a west-pointing arrow
* Tile with a south-pointing arrow
* Tile with a north-pointing arrow
* Tile w... |
Solve the programming task below in a Python markdown code block.
Based on the information of the time when study started and the time when study ended, check whether the total time studied in one day is t or more, and if not, create a program to find the shortage time. Time is one unit per hour, and minutes and secon... |
Solve the programming task below in a Python markdown code block.
Taro, a boy who hates any inefficiencies, pays coins so that the number of coins to be returned as change is minimized in order to do smoothly when he buys something.
One day, however, he doubt if this way is really efficient. When he pays more number ... |
Solve the programming task below in a Python markdown code block.
Whist is a game played by four players with a standard deck of playing cards. The players seat around a table, namely, in north, east, south, and west. This game is played in a team-play basis: the players seating opposite to each other become a team. I... |
Solve the programming task below in a Python markdown code block.
An undirected graph is given. Each edge of the graph disappears with a constant probability. Calculate the probability with which the remained graph is connected.
Input
The first line contains three integers N (1 \leq N \leq 14), M (0 \leq M \leq 10... |
Solve the programming task below in a Python markdown code block.
Min Element
Given the sequence a_1, a_2, .., a_N.
Find the minimum number in this sequence.
If the minimum value is in more than one place, answer the one with the lowest number.
input
N
a_1 a_2 ... a_N
output
Output the smallest i such that a_... |
Solve the programming task below in a Python markdown code block.
Remainder of Big Integers
Given two integers $A$ and $B$, compute the remainder of $\frac{A}{B}$.
Input
Two integers $A$ and $B$ separated by a space character are given in a line.
Output
Print the remainder in a line.
Constraints
* $0 \leq A, B ... |
Solve the programming task below in a Python markdown code block.
As you know, majority of students and teachers of Summer Informatics School live in Berland for the most part of the year. Since corruption there is quite widespread, the following story is not uncommon.
Elections are coming. You know the number of vot... |
Solve the programming task below in a Python markdown code block.
Berland State University invites people from all over the world as guest students. You can come to the capital of Berland and study with the best teachers in the country.
Berland State University works every day of the week, but classes for guest stude... |
Solve the programming task below in a Python markdown code block.
Recently you have received two positive integer numbers x and y. You forgot them, but you remembered a shuffled list containing all divisors of x (including 1 and x) and all divisors of y (including 1 and y). If d is a divisor of both numbers x and y at... |
Solve the programming task below in a Python markdown code block.
Bob is decorating his kitchen, more precisely, the floor. He has found a prime candidate for the tiles he will use. They come in a simple form factor β a square tile that is diagonally split into white and black part as depicted in the figure below.
<i... |
Solve the programming task below in a Python markdown code block.
n robots have escaped from your laboratory! You have to find them as soon as possible, because these robots are experimental, and their behavior is not tested yet, so they may be really dangerous!
Fortunately, even though your robots have escaped, you ... |
Solve the programming task below in a Python markdown code block.
The only difference between easy and hard versions is the number of elements in the array.
You are given an array a consisting of n integers. In one move you can choose any a_i and divide it by 2 rounding down (in other words, in one move you can set a... |
Solve the programming task below in a Python markdown code block.
As the name of the task implies, you are asked to do some work with segments and trees.
Recall that a tree is a connected undirected graph such that there is exactly one simple path between every pair of its vertices.
You are given n segments [l_1, r_... |
Solve the programming task below in a Python markdown code block.
Roma is playing a new expansion for his favorite game World of Darkraft. He made a new character and is going for his first grind.
Roma has a choice to buy exactly one of n different weapons and exactly one of m different armor sets. Weapon i has attac... |
Solve the programming task below in a Python markdown code block.
Today Johnny wants to increase his contribution. His plan assumes writing n blogs. One blog covers one topic, but one topic can be covered by many blogs. Moreover, some blogs have references to each other. Each pair of blogs that are connected by a refe... |
Solve the programming task below in a Python markdown code block.
In the game of Mastermind, there are two players β Alice and Bob. Alice has a secret code, which Bob tries to guess. Here, a code is defined as a sequence of n colors. There are exactly n+1 colors in the entire universe, numbered from 1 to n+1 inclusive... |
Solve the programming task below in a Python markdown code block.
Mr. Chanek is currently participating in a science fair that is popular in town. He finds an exciting puzzle in the fair and wants to solve it.
There are N atoms numbered from 1 to N. These atoms are especially quirky. Initially, each atom is in normal... |
Solve the programming task below in a Python markdown code block.
You have a knapsack with the capacity of W. There are also n items, the i-th one has weight w_i.
You want to put some of these items into the knapsack in such a way that their total weight C is at least half of its size, but (obviously) does not excee... |
Solve the programming task below in a Python markdown code block.
Polycarp found under the Christmas tree an array a of n elements and instructions for playing with it:
* At first, choose index i (1 β€ i β€ n) β starting position in the array. Put the chip at the index i (on the value a_i).
* While i β€ n, add a_i... |
Solve the programming task below in a Python markdown code block.
You have a malfunctioning microwave in which you want to put some bananas. You have n time-steps before the microwave stops working completely. At each time-step, it displays a new operation.
Let k be the number of bananas in the microwave currently. I... |
Solve the programming task below in a Python markdown code block.
Sergey attends lessons of the N-ish language. Each lesson he receives a hometask. This time the task is to translate some sentence to the N-ish language. Sentences of the N-ish language can be represented as strings consisting of lowercase Latin letters... |
Solve the programming task below in a Python markdown code block.
You've got string s, consisting of only lowercase English letters. Find its lexicographically maximum subsequence.
We'll call a non-empty string s[p1p2... pk] = sp1sp2... spk(1 β€ p1 < p2 < ... < pk β€ |s|) a subsequence of string s = s1s2... s|s|.
Stri... |
Solve the programming task below in a Python markdown code block.
Jabber ID on the national Berland service Β«BabberΒ» has a form <username>@<hostname>[/resource], where
* <username> β is a sequence of Latin letters (lowercase or uppercase), digits or underscores characters Β«_Β», the length of <username> is between 1... |
Solve the programming task below in a Python markdown code block.
Emuskald is a well-known illusionist. One of his trademark tricks involves a set of magical boxes. The essence of the trick is in packing the boxes inside other boxes.
From the top view each magical box looks like a square with side length equal to 2k ... |
Solve the programming task below in a Python markdown code block.
The problem uses a simplified TCP/IP address model, please make sure you've read the statement attentively.
Polycarpus has found a job, he is a system administrator. One day he came across n IP addresses. Each IP address is a 32 bit number, represented... |
Solve the programming task below in a Python markdown code block.
Smart Beaver decided to be not only smart, but also a healthy beaver! And so he began to attend physical education classes at school X. In this school, physical education has a very creative teacher. One of his favorite warm-up exercises is throwing bal... |
Solve the programming task below in a Python markdown code block.
In one little known, but very beautiful country called Waterland, lives a lovely shark Valerie. Like all the sharks, she has several rows of teeth, and feeds on crucians. One of Valerie's distinguishing features is that while eating one crucian she uses... |
Solve the programming task below in a Python markdown code block.
Petya is a beginner programmer. He has already mastered the basics of the C++ language and moved on to learning algorithms. The first algorithm he encountered was insertion sort. Petya has already written the code that implements this algorithm and sort... |
Solve the programming task below in a Python markdown code block.
In this problem we consider a special type of an auction, which is called the second-price auction. As in regular auction n bidders place a bid which is price a bidder ready to pay. The auction is closed, that is, each bidder secretly informs the organi... |
Solve the programming task below in a Python markdown code block.
Ryouko is an extremely forgetful girl, she could even forget something that has just happened. So in order to remember, she takes a notebook with her, called Ryouko's Memory Note. She writes what she sees and what she hears on the notebook, and the note... |
Solve the programming task below in a Python markdown code block.
Alex doesn't like boredom. That's why whenever he gets bored, he comes up with games. One long winter evening he came up with a game and decided to play it.
Given a sequence a consisting of n integers. The player can make several steps. In a single ste... |
Solve the programming task below in a Python markdown code block.
Petya studies in a school and he adores Maths. His class has been studying arithmetic expressions. On the last class the teacher wrote three positive integers a, b, c on the blackboard. The task was to insert signs of operations '+' and '*', and probabl... |
Solve the programming task below in a Python markdown code block.
Misha and Vasya participated in a Codeforces contest. Unfortunately, each of them solved only one problem, though successfully submitted it at the first attempt. Misha solved the problem that costs a points and Vasya solved the problem that costs b poin... |
Solve the programming task below in a Python markdown code block.
Vanya got an important task β he should enumerate books in the library and label each book with its number. Each of the n books should be assigned with a number from 1 to n. Naturally, distinct books should be assigned distinct numbers.
Vanya wants to ... |
Solve the programming task below in a Python markdown code block.
There is a programing contest named SnakeUp, 2n people want to compete for it. In order to attend this contest, people need to form teams of exactly two people. You are given the strength of each possible combination of two people. All the values of the... |
Solve the programming task below in a Python markdown code block.
You have array a that contains all integers from 1 to n twice. You can arbitrary permute any numbers in a.
Let number i be in positions xi, yi (xi < yi) in the permuted array a. Let's define the value di = yi - xi β the distance between the positions o... |
Solve the programming task below in a Python markdown code block.
Vasya decided to pass a very large integer n to Kate. First, he wrote that number as a string, then he appended to the right integer k β the number of digits in n.
Magically, all the numbers were shuffled in arbitrary order while this note was passed ... |
Solve the programming task below in a Python markdown code block.
As we all know Barney's job is "PLEASE" and he has not much to do at work. That's why he started playing "cups and key". In this game there are three identical cups arranged in a line from left to right. Initially key to Barney's heart is under the midd... |
Solve the programming task below in a Python markdown code block.
Dexterina and Womandark have been arch-rivals since theyβve known each other. Since both are super-intelligent teenage girls, theyβve always been trying to solve their disputes in a peaceful and nonviolent way. After god knows how many different challen... |
Solve the programming task below in a Python markdown code block.
In this problem you will write a simple generator of Brainfuck (<https://en.wikipedia.org/wiki/Brainfuck>) calculators.
You are given an arithmetic expression consisting of integers from 0 to 255 and addition/subtraction signs between them. Output a Br... |
Solve the programming task below in a Python markdown code block.
Due to the recent popularity of the Deep learning new countries are starting to look like Neural Networks. That is, the countries are being built deep with many layers, each layer possibly having many cities. They also have one entry, and one exit point... |
Solve the programming task below in a Python markdown code block.
Eighth-grader Vova is on duty today in the class. After classes, he went into the office to wash the board, and found on it the number n. He asked what is this number and the teacher of mathematics Inna Petrovna answered Vova that n is the answer to the... |
Solve the programming task below in a Python markdown code block.
Girl Lena likes it when everything is in order, and looks for order everywhere. Once she was getting ready for the University and noticed that the room was in a mess β all the objects from her handbag were thrown about the room. Of course, she wanted to... |
Solve the programming task below in a Python markdown code block.
Imp is in a magic forest, where xorangles grow (wut?)
<image>
A xorangle of order n is such a non-degenerate triangle, that lengths of its sides are integers not exceeding n, and the xor-sum of the lengths is equal to zero. Imp has to count the number... |
Solve the programming task below in a Python markdown code block.
Throughout Igor K.'s life he has had many situations worthy of attention. We remember the story with the virus, the story of his mathematical career and of course, his famous programming achievements. However, one does not always adopt new hobbies, one ... |
Solve the programming task below in a Python markdown code block.
Petya has an array a consisting of n integers. He wants to remove duplicate (equal) elements.
Petya wants to leave only the rightmost entry (occurrence) for each element of the array. The relative order of the remaining unique elements should not be ch... |
Solve the programming task below in a Python markdown code block.
View Russian Translation
Limak is a little polar bear.
Today he found something delicious in the snow.
It's a square bar of chocolate with N x N pieces.
Some pieces are special because there are cherries on them.
You might be surprised by cherries on a... |
Solve the programming task below in a Python markdown code block.
Little Pandey and GJ are coding buddies - since they are the part of ACM ICPC team together. But, GJ is fed up of Pandey's weird coding habits - like using editors which are slow, and irritating. Importantly, GJ believes that Pandey over-complicates a t... |
Solve the programming task below in a Python markdown code block.
You need to handle two extraordinarily large integers. The good news is that you don't need to perform any arithmetic operation on them. You just need to compare them and see whether they are equal or one is greater than the other.
Given two strings x ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.