Codeforce B. Polycarp and Letters】的更多相关文章

B. Polycarp and Letters time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Polycarp loves lowercase letters and dislikes uppercase ones. Once he got a string s consisting only of lowercase an…
Description Polycarp loves lowercase letters and dislikes uppercase ones. Once he got a string s consisting only of lowercase and uppercase Latin letters. Let A be a set of positions in the string. Let's call it pretty if following conditions are met…
Description Polycarp loves lowercase letters and dislikes uppercase ones. Once he got a string s consisting only of lowercase and uppercase Latin letters. Let A be a set of positions in the string. Let's call it pretty if following conditions are met…
http://codeforces.com/contest/864/problem/B 题意: 给出一个字符串,要求找到一个集合S,使得从S中选出的所有数,在这些数的位置上的字母全部为小写且是不同的字母,并且任意在S中两个数i,j,对于i  <  j,从i到j的所有位置上都为小写字母. 思路: 找出所有的大写字母的位置,在任意两个"相邻"(指的是这两个大写字母的中间不存在大写字母)的大写字母中寻找S,这样就可以保证全部为小写字母,用set保存出现过的字母就可以了. 代码: #in…
题意:给你一串长度为n的字符,由大小写字母组成,求连续的小写子串中不同字母个数的最大值. Input 11aaaaBaabAbA Output 2 Input 12zACaAbbaazzC Output 3 Input 3ABC Output 0 思路:水题,瞎搞搞就OK. 代码:#include<iostream>#include<string.h>#include<cmath>using namespace std; char s[250];int vis[30];…
额,这次的题目其实挺智障的.所以通过这次比赛,我也发现了自己是一个智障.... 不说太多,说多是泪... A. Fair Game 题意:给你一个数组,看你能否把它均分为两个所有元素均相同的子数组. 模拟即可.... #include<bits/stdc++.h> using namespace std; #define MAXN 100+10 ,b=; int main(){ scanf("%d",&n); ;i<=n;i++){ int x; scanf(…
A. Fair Game 题目链接:http://codeforces.com/contest/864/problem/A 水题 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<stack> #include<map> #include<vector> #incl…
Codeforces Round #436 (Div. 2) 敲出一身冷汗...感觉自己宛如智障:( codeforces 864 A. Fair Game[水] 题意:已知n为偶数,有n张卡片,每张卡片上都写有一个数,两个人每人选一个数,每人可以拿的卡片必须写有是自己选的数,问能否选择两个数使得两个人每人拿的卡片数一样多并且能拿光卡片.[就是看输入是不是只有两种数字] //:第一遍我看成字符串包含有选的数字也能拿,,这样写着居然过了..水题水题.. #include<cstdio> #inc…
A. Fair Game time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Petya and Vasya decided to play a game. They have n cards (n is an even number). A single integer is written on each card. Befor…
B. Polycarp and Letters time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Polycarp loves lowercase letters and dislikes uppercase ones. Once he got a string s consisting only of lowercase an…