记录一下每个对角线上有几个,然后就可以算了 #include<cstdio> #include<cstring> #include<cmath> #include<ctime> #include<vector> #include<algorithm> using namespace std; con
分类:
其他好文 时间:
2016-02-02 23:19:56
阅读次数:
231
方法可以转化一下,先计算每一个鲨鱼在自己范围内的数能被所给素数整除的个数有几个,从而得到能被整除的概率,设为f1,不能被整除的概率设为f2. 然后计算每相邻两只鲨鱼能获得钱的期望概率,f=w[id1].f1*w[id2].f2+w[id1].f2*w[id2].f1+w[id1].f1*w[id2]
分类:
其他好文 时间:
2016-02-02 23:19:18
阅读次数:
170
http://www.cnblogs.com/wenruo/p/5176375.html A. Wet Shark and Odd and Even 题意:输入n个数,选择其中任意个数,使和最大且为奇数。 题解:算出所有数的和,如果奇数的个数为奇数个,则减去最小的奇数,否则不用处理。 #includ
分类:
其他好文 时间:
2016-02-01 22:34:53
阅读次数:
248
C. Wet Shark and Flowers There are n sharks who grow flowers for Wet Shark. They are all sitting around the table, such that sharks i and i?+?1 are ne
分类:
其他好文 时间:
2016-02-01 22:29:16
阅读次数:
307
A. Wet Shark and Odd and Even Today, Wet Shark is given n integers. Using any of these integers no more than once, Wet Shark wants to get maximum poss
分类:
其他好文 时间:
2016-02-01 22:28:44
阅读次数:
179
B. Wet Shark and Bishops Today, Wet Shark is given n bishops on a 1000 by 1000 grid. Both rows and columns of the grid are numbered from 1 to 1000. Ro
分类:
其他好文 时间:
2016-02-01 22:23:48
阅读次数:
233
D. Rat Kwesh and Cheese Wet Shark asked Rat Kwesh to generate three positive real numbers x, y and z, from 0.1 to 200.0, inclusive. Wet Krash wants to
分类:
其他好文 时间:
2016-02-01 22:18:24
阅读次数:
326
在家都变的懒惰了,好久没写题解了,补补CF 模拟 A - Wet Shark and Odd and Even #include <bits/stdc++.h> typedef long long ll; const int N = 1e5 + 5; const int INF = 0x3f3f3f
分类:
其他好文 时间:
2016-02-01 20:40:03
阅读次数:
176
对角线 x1+y1=x2+y2 或者x1-y1=x2-y2 1 #include<iostream> 2 #include<string> 3 #include<algorithm> 4 #include<cstdlib> 5 #include<cstdio> 6 #include<set> 7 #
分类:
其他好文 时间:
2016-02-01 17:59:32
阅读次数:
154
题目链接:点击打开链接
题意:给n个数作为一个块,有b个块,从其中若干个中选择数,每个块只能选一个数,最后组成一个数模x等于k的方法数。
思路:很容易想到这样一个DP方程 : 用dp[i][j]表示现在i位,余数是j。那么dp[i + 1][(j * 10 + k) % x] = dp[i][j] * cnt[k],k是指枚举放1~9中哪一位。
因为b特别大,显然要矩阵优化,知道了DP方程,...
分类:
其他好文 时间:
2016-02-01 15:55:01
阅读次数:
306