3K+ Downloads
One of its unique features is an automated coding contest reminder, which sets alarms for upcoming coding contests on popular platforms like CodeChef, CodeForces, and LeetCode, without the need for user input. This feature ensures that users never miss a coding contest and can stay updated with the latest coding challenges.
How to Find Budget-Friendly VPS Solutions for Students
You are given 3 integers — 𝑛 , 𝑥 , 𝑦 . Let's call the score of a permutation† 𝑝1,…,𝑝𝑛 the following value: (𝑝1⋅𝑥+𝑝2⋅𝑥+…+𝑝⌊𝑛𝑥⌋⋅𝑥)−(𝑝1⋅𝑦+𝑝2⋅𝑦+…+𝑝⌊𝑛𝑦⌋⋅𝑦) In other words, the score of a permutation is the sum of 𝑝𝑖 for all indices 𝑖 divisible by 𝑥 , minus the sum of 𝑝𝑖 for all indices 𝑖 divisible by 𝑦 . You need to find the maximum possible score among all permutations of length 𝑛 . For example, if 𝑛=7 , 𝑥=2 , 𝑦=3 , the maximum score is achieved by the permutation [2,6⎯⎯,1⎯⎯,7⎯⎯,5,4⎯⎯⎯⎯,3] and is equal to (6+7+4)−(1+4)=17−5=12 .
You are given a string 𝑠 consisting of 𝑛 lowercase Latin letters. Let's define a substring as a contiguous subsegment of a string. For example, "acab" is a substring of "abacaba" (it starts in position 3 and ends in position 6 ), but "aa" or "d" aren't substrings of this string. So the substring of the string 𝑠 from position 𝑙 to position 𝑟 is 𝑠[𝑙;𝑟]=𝑠𝑙𝑠𝑙+1…𝑠𝑟 . You have to choose exactly one of the substrings of the given string and reverse it (i. e. make 𝑠[𝑙;𝑟]=𝑠𝑟𝑠𝑟−1…𝑠𝑙 ) to obtain a string that is less lexicographically. Note that it is not necessary to obtain the minimum possible string.
Winter holidays are coming up. They are going to last for 𝑛 days. During the holidays, Monocarp wants to try all of these activities exactly once with his friends: go skiing; watch a movie in a cinema; play board games. Monocarp knows that, on the 𝑖 -th day, exactly 𝑎𝑖 friends will join him for skiing, 𝑏𝑖 friends will join him for a movie and 𝑐𝑖 friends will join him for board games.
Tema and Vika are playing the following game. First, Vika comes up with a sequence of positive integers 𝑎 of length 𝑚 and writes it down on a piece of paper. Then she takes a new piece of paper and writes down the sequence 𝑏 according to the following rule: First, she writes down 𝑎1 . Then, she writes down only those 𝑎𝑖 (2≤𝑖≤𝑚 ) such that 𝑎𝑖−1≤𝑎𝑖 . Let the length of this sequence be denoted as 𝑛 .
Given an array 𝑎 of length 𝑛 , which elements are equal to −1 and 1 . Let's call the array 𝑎 good if the following conditions are held at the same time: 𝑎1+𝑎2+…+𝑎𝑛≥0 ; 𝑎1⋅𝑎2⋅…⋅𝑎𝑛=1 . In one operation, you can select an arbitrary element of the array 𝑎𝑖 and change its value to the opposite. In other words, if 𝑎𝑖=−1 , you can assign the value to 𝑎𝑖:=1 , and if 𝑎𝑖=1 , then assign the value to 𝑎𝑖:=−1 .
The company "Divan's Sofas" is planning to build 𝑛+1 different buildings on a coordinate line so that: the coordinate of each building is an integer number; no two buildings stand at the same point. Let 𝑥𝑖 be the coordinate of the 𝑖 -th building. To get from the building 𝑖 to the building 𝑗 , Divan spends |𝑥𝑖−𝑥𝑗| minutes, where |𝑦| is the absolute value of 𝑦 .
A class of students got bored wearing the same pair of shoes every day, so they decided to shuffle their shoes among themselves. In this problem, a pair of shoes is inseparable and is considered as a single object. There are 𝑛 students in the class, and you are given an array 𝑠 in non-decreasing order, where 𝑠𝑖 is the shoe size of the 𝑖 -th student. A shuffling of shoes is valid only if no student gets their own shoes and if every student gets shoes of size greater than or equal to their size.
You are given an array of integers 𝑎1,𝑎2,…,𝑎𝑛 and a number 𝑘 (2≤𝑘≤5 ). In one operation, you can do the following: Choose an index 1≤𝑖≤𝑛 , Set 𝑎𝑖=𝑎𝑖+1 . Find the minimum number of operations needed to make the product of all the numbers in the array 𝑎1⋅𝑎2⋅…⋅𝑎𝑛 divisible by 𝑘 .
Monocarp is playing yet another computer game. And yet again, his character is killing some monsters. There are 𝑛 monsters, numbered from 1 to 𝑛 , and the 𝑖 -th of them has 𝑎𝑖 health points initially.