Codeforces Round #295 (Div. 2)】的更多相关文章

水 A. Pangram /* 水题 */ #include <cstdio> #include <iostream> #include <algorithm> #include <map> #include <set> #include <cmath> #include <string> #include <cstring> using namespace std; int main(void) { //fr…
题意:给你一个数字n,有两种操作:减1或乘2,问最多经过几次操作能变成m: 随后发篇随笔普及下memset函数的初始化问题.自己也是涨了好多姿势. 代码 #include<iostream> #include<cstdio> #include<cstring> #include<cstdlib> #define INF 0x7fffffff; using namespace std; ], vis[]; int dp(int n, int m) { ) re…
题意:如题定义的函数,取最大值的数量有多少? 结论只猜对了一半. 首先,如果只有一个元素结果肯定是1.否则.s串中元素数量分别记为a,t,c,g.设另一个串t中数量为a',t',c',g'.那么,固定s串,移动t串时,增加的量为p=a*a'+t*t'+c*c'+g*g'.注意a'+t'+c'+g'是等于串长,那么减少a,t,c,g中最少的对应的那个a',t',c',g',增加到最大的那个上,p值是上升的.而且如果a==t那么a'和t'的数量互换是不影响p值的.因此结论是这种情况下,t串可随意 放…
C. DNA Alignment time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya became interested in bioinformatics. He's going to write an article about similar cyclic DNA sequences, so he invente…
B. Two Buttons time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya has found a strange device. On the front panel of a device there are: a red button, a blue button and a display showing…
A. Pangram time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A word or a sentence in some language is called a pangram if all the characters of the alphabet of this language appear in it at…
昨天ZZD大神邀请我做一道题,说这题很有趣啊. 哇,然后我被虐了. Orz ZZD 题目大意: 你有一个长度为n的'0-9'串,你要在其中加入k个'+'号,每种方案就会形成一个算式,算式算出来的值记做这次方案的贡献. 问:所有方案的贡献,对1e9+7取模. n,k<=1e5. 首先我和zzd先探讨了一会儿暴力一点的做法,唔,非常好弄的是k*n^2,枚举子串,考虑这个子串出现在了多少个方案中,然后就是枚举左边多少个'+',然后一堆组合数...啪啦啪啦... 然后觉得既然两边分的'+'号加起来的总和…
B. Two Buttons time limit per test : 2 seconds memory limit per test :256 megabytes input :standard input output : standard output Vasya has found a strange device. On the front panel of a device there are: a red button, a blue button and a display s…
B. Two Buttons time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya has found a strange device. On the front panel of a device there are: a red button, a blue button and a display showing…
B. Two Buttons time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya has found a strange device. On the front panel of a device there are: a red button, a blue button and a display showing…