随笔分类 - 题库—Codeforces比赛
摘要:题目描述 You are given a correct solution of the sudoku puzzle. If you don't know what is the sudoku, you can read about it here. The picture showing the
阅读全文
摘要:题目描述 You have n n n students under your control and you have to compose exactly two teams consisting of some subset of your students. Each student had
阅读全文
摘要:题目描述 You are given three positive integers n n n , a a a and b b b . You have to construct a string s s s of length n n n consisting of lowercase Lati
阅读全文
摘要:题目描述 There are two sisters Alice and Betty. You have n n n candies. You want to distribute these n n n candies between two sisters in such a way that:
阅读全文
摘要:You have an array aa of length nn . For every positive integer xx you are going to perform the following operation during the xx -th second: Select so
阅读全文
摘要:You have array of nn numbers a1,a2,…,ana1,a2,…,an . Rearrange these numbers to satisfy |a1−a2|≤|a2−a3|≤…≤|an−1−an||a1−a2|≤|a2−a3|≤…≤|an−1−an| , where
阅读全文
摘要:You have integer nn. Calculate how many ways are there to fully cover belt-like area of 4n−24n−2 triangles with diamond shapes. Diamond shape consists
阅读全文
摘要:You are given a complete directed graph KnKn with nn vertices: each pair of vertices u≠vu≠v in KnKn have both directed edges (u,v)(u,v) and (v,u)(v,u)
阅读全文
摘要:You are playing another computer game, and now you have to slay nn monsters. These monsters are standing in a circle, numbered clockwise from 11 to nn
阅读全文
摘要:Many years ago Berland was a small country where only nn people lived. Each person had some savings: the ii -th one had aiai burles. The government co
阅读全文
摘要:output standard output Polycarp has recently created a new level in this cool new game Berlio Maker 85 and uploaded it online. Now players from all ov
阅读全文
摘要:Eugene likes working with arrays. And today he needs your help in solving one challenging task. An array cc is a subarray of an array bb if cc can be
阅读全文
摘要:Once again, Boris needs the help of Anton in creating a task. This time Anton needs to solve the following problem: There are two arrays of integers a
阅读全文
摘要:Young boy Artem tries to paint a picture, and he asks his mother Medina to help him. Medina is very busy, that's why she asked for your help. Artem wa
阅读全文
摘要:Dreamoon likes coloring cells very much. There is a row of nn cells. Initially, all cells are empty (don't contain any color). Cells are numbered from
阅读全文
摘要:The sequence of mm integers is called the permutation if it contains all integers from 11 to mm exactly once. The number mm is called the length of th
阅读全文
摘要:Dreamoon is a big fan of the Codeforces contests. One day, he claimed that he will collect all the places from 11 to 5454 after two more rated contest
阅读全文
摘要:Word ss of length nn is called kk -complete if ss is a palindrome, i.e. si=sn+1−isi=sn+1−i for all 1≤i≤n1≤i≤n ; ss has a period of kk , i.e. si=sk+isi
阅读全文
摘要:A positive integer is called composite if it can be represented as a product of two positive integers, both greater than 11 . For example, the followi
阅读全文
摘要:Alice has a cute cat. To keep her cat fit, Alice wants to design an exercising walk for her cat! Initially, Alice's cat is located in a cell (x,y)(x,y
阅读全文