上一页 1 2 3 4 5 6 ··· 22 下一页

2017年11月9日

hihocoder #1486 : 物品价值

摘要: dp[i][j] 到第i个物品 状态为 j 的二进制串 能得到的最大价值 #include<cstdio> #include<cstring> #include<map> #include<iostream> #include<algorithm> #include<math.h> #include 阅读全文

posted @ 2017-11-09 20:04 HelloWorld!--By-MJY 阅读(121) 评论(0) 推荐(0) 编辑

hihocoder #1485 : hiho字符串

摘要: 求h i o前缀和 枚举每个位子 二分结束的位子 恰好是2个h 一个 i 一个 o #include<cstdio> #include<cstring> #include<map> #include<iostream> #include<algorithm> #include<math.h> #in 阅读全文

posted @ 2017-11-09 19:40 HelloWorld!--By-MJY 阅读(139) 评论(0) 推荐(0) 编辑

2017年11月7日

hihocoder #1566 : 皇室成员的名字

摘要: 把每个罗马数字转化成 阿拉伯数字 其实每次做做最长匹配就行 然后sort #include<cstdio> #include<cstring> #include<map> #include<iostream> #include<algorithm> #include<math.h> #include 阅读全文

posted @ 2017-11-07 09:07 HelloWorld!--By-MJY 阅读(170) 评论(0) 推荐(0) 编辑

2017年11月6日

hihocoder #1509 : 异或排序

摘要: 很有意思的题 中文 一开始拿到这个题没头绪 2^60的话 考虑相邻2个数 a 0 1 0 1 0 0 b 0 0 1 0 0 0 0 他们最高位不相同的 相同的异或同一个数还是相同所以考虑这位 0 1 那么s这位一定要是 0 , 0 1 就相反 然后都不能矛盾 这样就解决了 #include<cst 阅读全文

posted @ 2017-11-06 16:53 HelloWorld!--By-MJY 阅读(88) 评论(0) 推荐(0) 编辑

2017年10月25日

#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 阅读(139) 评论(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 阅读(343) 评论(0) 推荐(0) 编辑

2017年10月21日

#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 阅读(530) 评论(0) 推荐(0) 编辑

2017年10月17日

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 阅读(145) 评论(0) 推荐(0) 编辑

2017年10月11日

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 阅读(93) 评论(0) 推荐(0) 编辑

2017年9月6日

2015 百度之星初赛 1 2 2015ACM/ICPC亚洲区上海站 codeforces 851

摘要: A - 超级赛亚ACMer HDU - 5246 n m k m >=max( a[i] ); m < min(a[i]); 先判断掉 然后就可以找到最接近的 比m小的一个数 往上涨 看是否能行 O(n) #include<stdio.h> #include<string.h> #include<a 阅读全文

posted @ 2017-09-06 20:46 HelloWorld!--By-MJY 阅读(200) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 ··· 22 下一页

导航