水题 #include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int n,a,b; cin >> n >>a >> b; vector<,); int k; ; i < a; ++ i) { cin>>k; apple[k] = ; } ; i < b; ++ i) { cin…
需要满足的条件是 (1)每个字母是对称的 (2)每个字符串是对称的 #include <iostream> #include <algorithm> #include <string> using namespace std; const string mirrorChar = "AHIMOTUVWXY"; int main(){ string str; cin >> str; bool flag = true; ; i < str…
C. Online Meeting time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Nearly each project of the F company has a whole team of developers working on it. They often are in different rooms of the…
CF 420A  A. Start Up 题目链接: http://codeforces.com/problemset/problem/420/A 题目意思: 给一个字符串A,通过镜面反射后得到A',推断A和A'是否全然一样. 解题思路: 水题.分析知有些字母通过镜面反射后和原来一样. 代码: //#include<CSpreadSheet.h> #include<iostream> #include<cmath> #include<cstdio> #inc…
Bubble Cup 11 - Finals [Online Mirror, Div. 1] 一场很好玩的题啊! I. Palindrome Pairs 枚举哪种字符出现奇数次. G. AI robots 对\(r\)从大到小排序,然后cdq分治. 注意要对\(q-k,q+k,q\)进行离散化 B. Space Isaac 对原序列做差分,b[i]=a[i]-a[i-1] 如果我们要凑出\(x\),那么集合A中小于\(x\)的数字,要关于\(x/2\)对称,大于\(x\)的数字要关于\((x+m…
B. Bear and Compressing 题目链接  Problem - B - Codeforces   Limak is a little polar bear. Polar bears hate long strings and thus they like to compress them. You should also know that Limak is so young that he knows only first six letters of the English…
E - Bear and Forgotten Tree 2 思路:先不考虑1这个点,求有多少个连通块,每个连通块里有多少个点能和1连,这样就能确定1的度数的上下界. 求连通块用链表维护. #include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk make_pair #define PII pair<int, int> #define PLI pair<L…
E. Bear and Forgotten Tree 2 题目连接: http://www.codeforces.com/contest/653/problem/E Description A tree is a connected undirected graph consisting of n vertices and n  -  1 edges. Vertices are numbered 1 through n. Limak is a little polar bear. He once…
D. Delivery Bears 题目连接: http://www.codeforces.com/contest/653/problem/D Description Niwel is a little golden bear. As everyone knows, bears live in forests, but Niwel got tired of seeing all the trees so he decided to move to the city. In the city, N…
C. Bear and Up-Down 题目连接: http://www.codeforces.com/contest/653/problem/C Description The life goes up and down, just like nice sequences. Sequence t1, t2, ..., tn is called nice if the following two conditions are satisfied: ti < ti + 1 for each odd…