上一页 1 2 3 4 5 6 ··· 8 下一页
摘要: 题目 分析 算是概率dp不错的题。 $ dp[i][j] $表示有i个人时,这i个人中的第j个获胜的概率。 我们把i从1推到n,那么答案就是$ dp[n][i] $ 然后我们规定,第一个人就是庄。 然后我们枚举每个卡片tmp。 $ dp[i][j]=dp[i][j] + dp[i-1][j-tmp] 阅读全文
posted @ 2018-08-05 18:51 noble_(noblex) 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 题目 分析 蒟蒻根本不会博弈论。。。。。 只知道异或和判断Nim游戏。。 不是很懂输出的选择,所以发一篇博客以待复习 代码 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxn=600000; 4 int a[maxn] 阅读全文
posted @ 2018-08-05 00:56 noble_(noblex) 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 题目 分析 发现我们关心的不是棋子的位置,我们只关心棋子数量就ok。 首先每行每列最多两个棋子。这是显然的。 然后我觉得本题最难的部分就是对行进行讨论,蒟蒻我一直被限制在了对格点讨论。。。。 $dp[i][j][k] $放了前$i$行,有$j$列有1个棋子,有$k$列有2个棋子。转移就很显然了。 代 阅读全文
posted @ 2018-08-05 00:51 noble_(noblex) 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 题目 分析 数学期望 用$ dp[i][j] $表示发现了在$ j $个子系统里面发现了$ i $个bug到$ s $个子系统里面发现了$ n $个bug需要的期望天数。 $ dp[0][0] $就是答案。 然后分类一下,可以转移到$ dp[i][j] $无非就是$ dp[i+1][j+1] $ $ 阅读全文
posted @ 2018-08-02 13:14 noble_(noblex) 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 题目 分析 对着Trie图搞快速幂。 为什么这样是对的呢? 详见:http://www.matrix67.com/blog/archives/276 有些地方还不是很理解。。。。。。为什么节点还要往下扩展? 有空再来搞一搞 代码 1 //#include <bits/stdc++.h> 2 #inc 阅读全文
posted @ 2018-07-29 17:05 noble_(noblex) 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 题目 分析 数位dp 状压一下现在的$ O(nlogn) $的$ LIS $的二分数组 数据小,所以更新时直接暴力不用二分了。 代码 #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn= 阅读全文
posted @ 2018-07-25 00:51 noble_(noblex) 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 题目 分析 线段树维护一下最大子序列 维护一下最大前缀 最大后缀 区间和 就ok了 好像只能用结构体。。。。。 代码 #include <bits/stdc++.h> using namespace std; const int maxn=505000; int val[maxn<<2] ; str 阅读全文
posted @ 2018-07-12 11:35 noble_(noblex) 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 题目 分析 最短路显然,但不好搞地位等级。。。。。 地位等级不好搞?那么就暴力。。 枚举我们允许的地位等级,跑最短路。 所以$ n^2logn $出100什么鬼啊,很有迷惑性啊 还有4篇cf没补博客好慌啊 代码 细节不少,WA了好几发 //#include <bits/stdc++.h> #incl 阅读全文
posted @ 2018-07-06 01:10 noble_(noblex) 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 题目 A:A - If at first you don't succeed... 分析: 按照题意模拟 代码: #include <bits/stdc++.h> using namespace std; int main(){ int a,b,c,n; scanf("%d%d%d%d",&a,&b 阅读全文
posted @ 2018-07-04 23:42 noble_(noblex) 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 题目 A:A - Hit the Lottery 分析: 大水题 模拟 代码: #include <bits/stdc++.h> using namespace std; int main(){ int n; int x=0;scanf("%d",&n); while(n>=100){ x++; n 阅读全文
posted @ 2018-07-04 15:24 noble_(noblex) 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 题目 A:Codehorses T-shirts 题意: 给定一些字符串表示去年和今年的衣服型号大小( XL XXL M...... ),要求用最少的次数把去年的衣服大小改成今年需要的。每次改动只能更改字符,不能增添字符。 分析: 把今年和去年的型号字典序排一下。然后用挨个对上(因为题目保证合法,所 阅读全文
posted @ 2018-07-03 00:49 noble_(noblex) 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 题目 分析 凉凉。 答案是所有要经过的点到根所经过的边权和减去最大的边权。 代码 vector好慢啊 #include <cstdio> #include <vector> #include <algorithm> using namespace std; const int maxn=105000 阅读全文
posted @ 2018-06-29 21:23 noble_(noblex) 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 题目 分析 好神的结论啊 看代码吧(Length只有85) 代码 顺手压了压代码 目前代码长度rk1 vjudge #include <iostream> int n;main(){while(std::cin>>n&&n)printf("%d\n",n<4?1:n==4?2:n);} 正常版: # 阅读全文
posted @ 2018-06-27 11:42 noble_(noblex) 阅读(343) 评论(0) 推荐(1) 编辑
摘要: 题目 分析 看到$ M<=10 $考虑状压。 然后把每行都压一下,那么每个状态相关的就是上一行和上上行的状态。 然后枚举。 然后复杂度最坏是$ O(100 \times 1024^3) $的 仔细分析一下,有很多状态是无用的,但还是被判断了,比如$ 11111 $,显然不能做到不误伤。 那么我们把所 阅读全文
posted @ 2018-06-26 22:41 noble_(noblex) 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 题目 分析 题意:给个数列,求有多少五元上升组 考虑简化一下问题:如果题目求二元上升组怎么做。 仿照一下逆序对,用树状数组维护一下就ok了。 三元怎么做呢? 把二元的拓展一位就可以了,即把第三个也扔进树状数组 所以这题就渐渐明朗了: 用$ dp[i][x] $表示以$ A[x] $结尾的$ x $元 阅读全文
posted @ 2018-06-26 15:03 noble_(noblex) 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 题目 分析 $ n<= 16 $ 显然是状压 然后搞一搞(靠着蓝书yy一下) 代码 #include <bits/stdc++.h> using namespace std; const int maxn=17; int n, P[maxn], cover[1<<maxn], f[1<<maxn]; 阅读全文
posted @ 2018-06-26 11:32 noble_(noblex) 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 题目 分析 大力dp。用$ dp[i][j] $表示$ [i,j] $A能得到的最高分 我看到博弈论就怂。。。 代码 #include <bits/stdc++.h> using namespace std; const int maxn=110; int S[maxn],A[maxn],vis[m 阅读全文
posted @ 2018-06-26 11:27 noble_(noblex) 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 题目 分析 水题。$ O(nlogn) $的LCS 代码 #include <bits/stdc++.h> using namespace std; const int maxn=255*260, INF=1e9; int S[maxn], g[maxn], d[maxn]; int num[max 阅读全文
posted @ 2018-06-25 23:56 noble_(noblex) 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 题目 分析 太喵了~~~~~ 还有中途相遇法这种东西的。 嗯 以后可以优化一些暴力 详情左转蓝书P58 (但可能我OI生涯中都遇不到正解是这个的题把。。。。。。 代码 #include <bits/stdc++.h> using namespace std; const int maxn=25; m 阅读全文
posted @ 2018-06-25 20:16 noble_(noblex) 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 题目 分析 好喵啊~~~~ 不会做 正解看蓝书P53吧 代码 #include <cstdio> #include <algorithm> using namespace std; inline int read() { int x = 0, f = 1; char ch = getchar(); 阅读全文
posted @ 2018-06-25 17:33 noble_(noblex) 阅读(122) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 8 下一页
/* */