原题: 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...
problem 视频讲解链接:https:///video/BV1Du411X7Nk solution 可以直接推导原答案ans = ∑ i = 1 n ∑ j = i n ( m a x ? m i n ) = ∑ i = 1 n ∑ j = i n m a x ? ∑ i = 1 n ∑ j = i n m i n \sum_{i=1}^n\sum_{j=i}^n(...
目录 A B C D E F G Dashboard - Codeforces Round #806 (Div. 4) - Codeforces A 题意: 判断一个字符串是否由yes组成 很无聊... #include <bits/stdc++.h> using namespace std;
#pragma warning(disable:4996);
#define ll long long
#define int ll...
Educational Codeforces Round 75 (Rated for Div. 2) A~E2 A. Broken Keyboard 链接 #include<bits/stdc++.h>
using namespace std;
int st[30];
int main()
{ int T; cin >> T; while (T--) { string s; cin >> s; for (int i = 0; i <...
Timur has nn candies. The ii-th candy has a quantity of sugar equal to a_ia i ? . So, by eating the ii-th candy, Timur consumes a quantity of sugar equal to a_ia i ? . Timur will ask you qq queries regarding his candies. For the jj-th query you have to a...
Codeforces separates its users into 44 divisions by their rating: For Division 1: 1900 \leq \mathrm{rating}1900≤rating For Division 2: 1600 \leq \mathrm{rating} \leq 18991600≤rating≤1899 For Division 3: 1400 \leq \mathrm{rating} \leq 15991400≤rating≤...
There are nn boxes with different quantities of candies in each of them. The ii-th box has a_ia i ? candies inside. You also have nn friends that you want to give the candies to, so you decided to give each friend a box of candies. But, you don’t want a...
Given an array a=[a_1,a_2,\dots,a_n]a=[a 1 ? ,a 2 ? ,…,a n ? ] of nn positive integers, you can do operations of two types on it: Add 11 to every element with an odd index. In other words change the array as follows: a_1 := a_1 +1, a_3 :...
Given an array aa of nn elements, print any value that appears at least three times or print -1 if there is no such value. Input The first line contains an integer tt (1 \leq t \leq 10^41≤t≤10 4 ) — the number of test cases. The first line of each tes...