码迷,mamicode.com
首页 >  
搜索关键字:battle    ( 273个结果
Codeforces 1045D Interstellar battle
Interstellar battle 对于每个联通块的贡献我们把它放到深度最低的那个点上面去。 那么一个点有贡献就是它的父亲被摧毁了并且自己没有被摧毁。 然后把所有概率加起来就是期望了。 ...
分类:其他好文   时间:2019-10-16 19:50:17    阅读次数:67
UVA12983 The Battle of Chibi
第一眼能看出来是个dp O($n^3$) 暴力应该很好想 dp\[i][j] = $\sum_{k=1}^i [a[k] include include include using namespace std; const int N = 1005; const int P = 1e9+7; int ...
分类:其他好文   时间:2019-10-06 00:38:04    阅读次数:98
pat 顶级 1001 Battle Over Cities - Hard Version (35 分)
It is vitally important to have all the cities connected by highways in a war. If a city is conquered by the enemy, all the highways from/toward that ...
分类:其他好文   时间:2019-09-11 11:26:40    阅读次数:95
dp练习
1013 Battle Over Cities 原来的图不一定连通,所以dfs统计连通块的时候要遍历所有的点。 pta总是有一些奇怪的边缘数据, code c++ include include include include include include include include incl ...
分类:其他好文   时间:2019-09-02 00:08:03    阅读次数:119
C - The Battle of Chibi HDU - 5542 (树状数组+离散化)
Cao Cao made up a big army and was going to invade the whole South China. Yu Zhou was worried about it. He thought the only way to beat Cao Cao is to ...
分类:编程语言   时间:2019-08-08 21:28:07    阅读次数:118
PAT 甲级 1013 Battle Over Cities (25 分)(图的遍历,统计强连通分量个数,bfs,一遍就ac啦)
1013 Battle Over Cities (25 分) 1013 Battle Over Cities (25 分) 1013 Battle Over Cities (25 分) It is vitally important to have all the cities connected ...
分类:其他好文   时间:2019-08-01 22:51:12    阅读次数:234
Codeforces 1141E Superhero Battle
题目大意: 给出长度为$n$的序列$d_i$和生命值$H$,每次到达该位置后生命值更新为$H+d_i$,求$H$首次为零的时段 思路: 首先想到先跑$\ | \frac{H}{\sum{d_i}}\ | 1$次然后跑最后一轮,但是序列的最小前缀可能远远小于$\sum{d_i}$,所以跑$\ | \f ...
分类:其他好文   时间:2019-07-22 09:52:40    阅读次数:86
PAT-Battle Over Cities - Hard Version (35 分)-最小生成树
这个题的题意是假设某个城市被占领后,要使剩下的城市保持联通可能会花钱修路,求最小花费里花费最多的那个被占领的城市。 这个题凭感觉就是最小生成树,最小生成树满足权值最小(最小花费),所以依次去掉某个城市的所有与其相接的路径,把剩下的路加入最小生成树,求最大值即可。 有一个地方写的时候没注意到,就是去掉 ...
分类:其他好文   时间:2019-07-13 15:02:47    阅读次数:212
安猪瀚的一家之言:多读书,多看报,少吃零食,多睡觉
想来这是我博客发的第二篇非技术文章了,6年前开博的时候就给自己立下一条规矩,只谈技术,不谈风月。 一来觉得写那些心情随想、人生感悟什么的,未免有些老气横秋的感觉,二来是觉得写这种文章的人未免总有一些居高临下,假借教诲的感觉,因为文字这种东西,读者在读的时候只能看到文字,无法和作者当庭battle,就 ...
分类:其他好文   时间:2019-07-07 12:39:38    阅读次数:128
The Battle of Chibi
"The Battle of Chibi" 给出一段长度为n的序列$\{a_i\}$,求其中长度为m的严格上升子序列个数$mod\ 10^9+7$,$n\leq 10^3$。 解 不难想到设$f[i][j]$表示以第i个位置结尾,长度为j的LSIS,因此我们有 $$f[i][j]=\sum_{k=1 ...
分类:其他好文   时间:2019-06-01 09:21:20    阅读次数:91
273条   上一页 1 2 3 4 5 ... 28 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!