F. Prefixes and Suffixes Codeforces Solution Kotlin Heroes: Practice 7

F. Prefixes and Suffixes Codeforces Solution 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 from 1 to n−1), but … Read more

E. Good Array Codeforces Solution Kotlin Heroes: Practice 7

E. Good Array Codeforces Solution Let’s call an array good if there is an element in the array that equals to the sum of all other elements. For example, the array a=[1,3,3,7] is good because there is the element a4=7 which equals to the sum 1+3+3. You are given an array a consisting of n … Read more

D. Teams Forming Codeforces Solution Kotlin Heroes: Practice 7

D. Teams Forming Codeforces Solution There are n students in a university. The number of students is even. The i-th student has programming skill equal to ai. The coach wants to form n2 teams. Each team should consist of exactly two students, and each student should belong to exactly one team. Two students can form … Read more

C. Uniform String Codeforces Solution Kotlin Heroes: Practice 7

C. Uniform String Codeforces Solution You are given two integers n and k. Your task is to construct such a string s of length n that for each i from 1 to k there is at least one i-th letter of the Latin alphabet in this string (the first letter is ‘a’, the second is … Read more

B. Frog Jumping Codeforces Solution Kotlin Heroes: Practice 7

B. Frog Jumping Codeforces Solution A frog is currently at the point 0 on a coordinate axis Ox. It jumps by the following algorithm: the first jump is a units to the right, the second jump is b units to the left, the third jump is a units to the right, the fourth jump is … Read more

A. A+B (Trial Problem) Codeforces Solution Kotlin Heroes: Practice 7

A. A+B (Trial Problem) Codeforces Solution You are given two integers a and b. Print a+b. InputThe first line contains an integer t (1≤t≤104) — the number of test cases in the input. Then t test cases follow. Each test case is given as a line of two integers a and b (−1000≤a,b≤1000). OutputPrint t … Read more

error: Content is protected !!
Please Click on 1 or 2 Ads to help us run this site.