You are given an array a1,a2,…,an, which is sorted in non-descending order. You decided to perform the following steps to create array b1,b2,…,bn Create an array d consisting of n arbitrary non-negative integers.Set bi=ai+di for each bi.Sort th...
原题: You are given a string s, consisting of lowercase Latin letters. You are asked q queries about it: given another string t, consisting of lowercase Latin letters, perform the following steps: concatenate s and t; calculate the prefix function...
Codeforces Round #842 (Div. 2) C. Elemental Decompress Two cases produce no answers: One element appears more than twice in a a aAfter sorting, there is some index that a [ i ] < i a[i]<i a[i]<i ( 1 1 1-indexed). Consider there is some index tha...
A Find The Array 题意 给你一个 a a a数组,这个数组是好的当且仅当这个数组的元素为1或者 a i a_i ai?-1、 a i a_i ai?-2在数组中出现过。给你一个数组和 s s s,问数组最小多长就可以满足数组和为 s s s。 s < = 1 e 3 s<=1e3 s<=1e3 思...
A. Hayato and School Today Hayato came home from school with homework. In the assignment, Hayato was given an array?a?of length?n. The task was to find?3?numbers in this array whose sum is?odd. At school, he claimed that there are such?3?numbers, but Hay...
题目链接 A. Watermelon B. Before an Exam C. Registration system D. Mysterious Present 题目描述 A. Watermelon 给定一个数 w w w,能否将这个 w w w 分成两个偶数。可以就打印 YES,否则打印 NO。 输入 8 输出 YES 数据范围 1 ? ≤ ? w ? ≤ ? 100 1?≤?w?...
比赛链接:Dashboard - Codeforces Round #847 (Div. 3) - Codeforces 目录 ? ? ? ? ?A. Polycarp and the Day of Pi? B. Taisia and Dice? C. Premutation D. Matryoshkas E. Vlad and a Pair of Numbers A. Polycarp and the Day of Pi? 题意:求出一个数字的...
Codeforces Round #805 (Div. 3) E. Split Into Two Sets Polycarp has n n n dominoes, on each domino there are 2 2 2 numbers — it turns out, there will be 2 n 2n 2n numbers in total. We need to divide 2 n 2n 2n numbers (each number from 1 1 1 to n n n) int...
Powered by:NEFU AB-IN Link 文章目录 Codeforces Round 849 (Div. 4) A Codeforces Checking题意思路代码 B. Following Directions题意思路代码 C. Prepend and Append题意思路代码 D. Distinct Split题意思路代码 E. Negatives and Positives题意思路代码 F. Range Update...
Let's denote the?f(x) function for a string?x?as the number of distinct characters that the string contains. For example?f(abc)=3,?f(bbbbb)=1, and?f(babacaba)=3. Given a string?s, split it into two non-empty strings?a?and?b?such that?f(a)...
目录 A. Codeforces Checking B. Following Directions C. Prepend and Append D. Distinct Split E. Negatives and Positives F. Range Update Point Query G1. Teleporters (Easy Version) G2. Teleporters (Hard Version) A. Codeforces Checking 题意:给你一个字...