水题 #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…
Codeforces Round #297 (Div. 2)B. Pasha and String Time Limit: 2 Sec  Memory Limit: 256 MBSubmit: xxx  Solved: 2xx 题目连接 http://codeforces.com/contest/525/problem/B Description Pasha got a very beautiful string s for his birthday, the string consists o…
题目传送门 /* 题意:给出m个位置,每次把[p,len-p+1]内的字符子串反转,输出最后的结果 字符串处理:朴素的方法超时,想到结果要么是反转要么没有反转,所以记录 每个转换的次数,把每次要反转的反转就不超时了:) */ #include <cstdio> #include <algorithm> #include <cstring> using namespace std; ; const int INF = 0x3f3f3f3f; char s[MAXN]; i…
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…