题目链接:http://www.codeforces.com/problemset/problem/96/A题意:判断一个0-1字符串中出现的最长的0字串或者1字串的长度是否大于等于7.C++代码: #include <cstdio> #include <iostream> #include <string> using namespace std; string s; ; bool chk() { int len = s.length(); ; i < len;…
题目链接:http://www.codeforces.com/problemset/problem/281/A题意:将一个英文字母的首字母变成大写,然后输出.C++代码: #include <cstdio> #include <cstring> ]; void solve(char *s) { if (*s >= 'a' && *s <= 'z') *s -= ; while (*s) { putchar(*s); s ++; } } int main(…
题目链接:http://www.codeforces.com/problemset/problem/71/A题意:将长字符串改成简写格式.C++代码: #include <string> #include <iostream> using namespace std; int n; string s; int main() { cin >> n; while (n --) { cin >> s; ) cout << s[] << s.…
题目链接:http://www.codeforces.com/problemset/problem/327/A题意:你现在有n张牌,这些派一面是0,另一面是1.编号从1到n,你需要翻转[i,j]区间的牌一次,使得看到的牌是1的数量最大.C++代码: #include <iostream> using namespace std; ; int n, a[maxn], sum[maxn]; int flip(int L, int R) { ]; - a1; //cout << &quo…
题目链接:http://www.codeforces.com/problemset/problem/271/A题意:给你一个四位数,求比这个数大的最小的满足四个位的数字不同的四位数.C++代码: #include <iostream> #include <algorithm> using namespace std; bool chk(int x) { ]; ; i < ; i ++) { a[i] = x % ; x /= ; } sort(a, a + ); ; i &l…
A. Football time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Petya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a…
Codeforces Beta Round #77 (Div. 2 Only) http://codeforces.com/contest/96 A #include<bits/stdc++.h> using namespace std; #define lson l,mid,rt<<1 #define rson mid+1,r,rt<<1|1 #define sqr(x) ((x)*(x)) #define pb push_back #define eb emplac…
题目链接:http://www.codeforces.com/problemset/problem/131/A题意:字符串大小写转换.C++代码: #include <cstdio> #include <cstring> ]; bool islow(char c) { return c >= 'a' && c <= 'z'; } char up(char c) { ; } char low(char c) { ; } bool check() { cha…
题目链接:http://www.codeforces.com/problemset/problem/339/A题意:重新组合加法字符串,使得按照1,2,3的顺序进行排列.C++代码: #include <iostream> #include <string> using namespace std; ]; string s, ans = ""; int main() { cin >> s; int len = s.length(); ; i <…
题目链接:http://www.codeforces.com/problemset/problem/112/A题意:忽略大小写,比较两个字符串字典序大小.C++代码: #include <cstdio> #include <cstring> int cmp(char *s, char *t) { while (*s) { ; ; ; ; s ++; t ++; } ; } int main() { ]; ]; scanf("%s%s", s, t); print…