原题链接 Problem - B - Codeforces 题意 给一串数,要把任意两个相邻的数的最大公约数=1 每次可以进行一个操作: 取下标为i, j的数,和任意二数x,y,且min(ai,aj)=min(x,y) 满足上述条件,即可使ai=x,aj=y 限制条件:操作次数 <= n 解析 找到数列最小值,操作完是最小值不变,其余数大小=最小值+(每个数与最小数下标差值) 换句话说:以最小值为中心,两边依次递增. 附:每次以最小值操作可以保证不越界,而且具有稳定性,不会出现操作者的值小于最小…
B. Amr and The Large Array Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/558/problem/B Description Amr has got a large array of size n. Amr doesn't like large arrays so he intends to make it smaller. Amr doesn't care abou…
Amr has got a large array of size n. Amr doesn't like large arrays so he intends to make it smaller. Amr doesn't care about anything in the array except the beauty of it. The beauty of the array is defined to be the maximum number of times that some…
B. Mike and Shortcuts time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Recently, Mike was very busy with studying for exams and contests. Now he is going to chill a bit by doing some sight…
C. Vasya and String time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output ->  Link  <- 题目就不贴出来了,链接在上面: 题意:给定n,k,然后是一个长度为n的只含字母a.b的字符串,问至多改变k次使得一个子串字母都相同且长度最大,如所给样例: input 10 1 bbabbabbba output…
B. Mislove Has Lost an Array time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Mislove had an array a1, a2, ⋯, an of n positive integers, but he has lost it. He only remembers the following facts…
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate it n = int(raw_input()) s = "" a = ["I hate that ","I love that ", "I hate it","I love it"] for i in ran…
Codeforces Round #354 (Div. 2) Problems     # Name     A Nicholas and Permutation standard input/output 1 s, 256 MB    x3384 B Pyramid of Glasses standard input/output 1 s, 256 MB    x1462 C Vasya and String standard input/output 1 s, 256 MB    x1393…
直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输出”#Color”,如果只有”G”,”B”,”W”就输出”#Black&White”. #include <cstdio> #include <cstring> using namespace std; const int maxn = 200; const int INF =…
 cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅.....       其实这个应该是昨天就写完的,不过没时间了,就留到了今天.. 地址:http://codeforces.com/contest/651/problem/A A. Joysticks time limit per test 1 second memory limit per test 256…