题目链接:http://www.codeforces.com/problemset/problem/25/A题意:在n个书中找到唯一一个奇偶性和其他n-1个数不同的数.C++代码: #include <iostream> using namespace std; ; , y = -; int main() { cin >> n; ; i <= n; i ++) { cin >> a; == ) x = (x == -) ? i : -; else y = (y =…
题目链接: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/122/A题意:判断一个数是否能被一个lucky number整除,一个lucky number是一个只包含4或7的数.C++代码: #include <cstdio> ] = {, , , , , , , , , , , , , }; bool check(int x) { ; i < ; i ++) ) return true; return false; } int main() {…
A. IQ test time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Bob is preparing to pass IQ test. The most frequent task in this test is to find out which one of the givenn numbers differs from…
Codeforces Beta Round #25 (Div. 2 Only) http://codeforces.com/contest/25 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 maxn 500005 typedef long long…
题目链接:http://www.codeforces.com/problemset/problem/231/A题意:问n道题目当中有多少道题目是至少两个人会的.C++代码: #include <iostream> using namespace std; int n, a, b, c, ans; int main() { cin >> n; while (n--) { cin >>a >> b >> c; ) ans ++; } cout <…
题目链接: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/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/460/A题意:Vasya每天用掉一双袜子,她妈妈每m天给他送一双袜子,Vasya一开始有n双袜子,请问第几天的时候Vasya会没有袜子穿?C++代码: #include <iostream> using namespace std; int n, m; int main() { cin >> n >> m; ; while (n) { d ++; if (n) n --…