10 2017 档案

#1506 : 投掷硬币
摘要:中文题 显然是要dp dp[i][j] 考虑到 i 个 正面为j 个的概率 dp[i][j]= dp[i-1][j]*(1-p[i])+dp[i-1][j-1]*p[i]; j=0特判下 #include<cstdio> #include<cstring> #include<map> #includ 阅读全文

posted @ 2017-10-25 22:13 HelloWorld!--By-MJY 阅读(146) 评论(0) 推荐(0)

hihocoder 1505 小Hi和小Ho的礼物
摘要:中文题 n^4 就不说了 显然n^2可以 那么我们可以求出每两个能得出的和的个数 然后每个数出现的次数 考虑a[i] a[j] 相同 那么 可以加上 sum[a[i]+a[j]] 那么多算了什么呢 多算了 给另外一个人cnt[a[i]] -1 同理 cnt[a[j]]-1 然后有一个重复了 +1 不 阅读全文

posted @ 2017-10-25 21:42 HelloWorld!--By-MJY 阅读(349) 评论(0) 推荐(0)

#1589 : 回文子串的数量
摘要:manager 算法 求得每个字母为中心的回文串的数量 然后 对那个数组统计一下 #include<iostream> #include<math.h> #include<stdio.h> #include<algorithm> #include<string.h> #include<vector> 阅读全文

posted @ 2017-10-21 08:22 HelloWorld!--By-MJY 阅读(545) 评论(0) 推荐(0)

hdu 6214
摘要:求最小割边的数目 w=w*300+1 ans%300; #include<iostream> #include<math.h> #include<stdio.h> #include<algorithm> #include<string.h> #include<vector> #include<que 阅读全文

posted @ 2017-10-17 09:21 HelloWorld!--By-MJY 阅读(157) 评论(0) 推荐(0)

poj 2104 C - Count on a tree
摘要:#include<iostream> #include<cstdio> #include<algorithm> #include<set> #include<string.h> #define MAXN 1000100 #define ll long long using namespace std 阅读全文

posted @ 2017-10-11 22:14 HelloWorld!--By-MJY 阅读(103) 评论(0) 推荐(0)

导航