. Hungry Sequence time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money,…
题目传送门 /* 贪心:暴力贪心水水 */ #include <cstdio> #include <algorithm> #include <cstring> using namespace std; ; const int INF = 0x3f3f3f3f; int a[MAXN]; int main(void) //Codeforces Round #191 (Div. 2) A. Flipping Game { int n; scanf ("%d&quo…
在div 188中,幸运的达成了这学期的一个目标:CF1800+,所以这次可以打星去做div2,有点爽. A.Flipping Game 直接枚举 B. Hungry Sequence 由于素数的分布大概10个中有一个,所以直接筛法筛1e5个即可. C. Magic Five 删除串s中的某些字符,使得他整除5,并且跟删除顺序有关,现在问有k个串s连在一起组成一个新的串,问新的串有多少种删除方式. 我们可以先看每一个串,由于整除5的数的末尾只能为0或者5. 用样例二 13990作为说明. 考虑只…
B. Lipshitz Sequence Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/601/problem/B Description A function  is called Lipschitz continuous if there is a real constant K such that the inequality |f(x) - f(y)| ≤ K·|x - y| hold…
A. Infinite Sequence 题目连接: http://www.codeforces.com/contest/675/problem/A Description Vasya likes everything infinite. Now he is studying the properties of a sequence s, such that its first element is equal to a (s1 = a), and the difference between…
链接: https://codeforces.com/contest/1265/problem/D 题意: An integer sequence is called beautiful if the difference between any two consecutive numbers is equal to 1. More formally, a sequence s1,s2,-,sn is beautiful if |si−si+1|=1 for all 1≤i≤n−1. Trans…
Vasya likes everything infinite. Now he is studying the properties of a sequence s, such that its first element is equal to a (s1 = a), and the difference between any two neighbouring elements is equal to c (si - si - 1 = c). In particular, Vasya won…
D. Block Tower time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output After too much playing on paper, Iahub has switched to computer games. The game he plays is called "Block Towers". It is…
Flipping Game time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Iahub got bored, so he invented a game to be played on paper. He writes n integers a1, a2, ..., an. Each of those integers can…
题目链接: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…