摘要: 毫无意义的一道题。 用pai[i]表示某种点数的牌的剩余量,used[i]表示单,对,三,四的出牌数,大力分类讨论,大力dfs即可。。。真奇葩。。。 cpp include include include using namespace std; int T,n,ans,pai[20],used[6 阅读全文
posted @ 2018-07-27 21:35 SWHsz 阅读(322) 评论(0) 推荐(0) 编辑
摘要: tarjan缩点+拓扑排序+DP。 让求的其实是缩点后最长链的长度和最长链的个数。基本操作。(注意去重边。。。) cpp include include include include include include using namespace std; queueq; const int N= 阅读全文
posted @ 2018-07-27 17:23 SWHsz 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 一看n=10,大力dfs啊。。。每次切的长度一定x/n的倍数。 cpp include include include using namespace std; int N,X,Y; double dfs(double x,double y,double n) { if(n==1) {return 阅读全文
posted @ 2018-07-27 12:21 SWHsz 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 矩阵加速递推。 图片出处见水印 cpp include include include define int long long using namespace std; int K,b[20],c[20],m,n,p; long long sum[20]; struct Matrix { int 阅读全文
posted @ 2018-07-27 11:06 SWHsz 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 期望dp。 基本套路就是逆推一下,可以忽略不能到达的情况。因为n,K输入反,re2次。。。 cpp include include include include using namespace std; int K,n; double f[105][1 阅读全文
posted @ 2018-07-27 07:56 SWHsz 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 一开始以为是数位dp,但是想到什么68,688的倍数怎么求就懵了。。。但是发现只有10位,有1024个幸运数字,我们可以把这些数算出来,容斥原理做一下。 cpp include include include include include using namespace std; long lon 阅读全文
posted @ 2018-07-27 07:21 SWHsz 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 以行,列为左右部点,跑最大匹配,匹配数为n即可。 cpp include include include using namespace std; int T,n,tim; int g[205][205];int vis[205],match[205]; bool dfs(int x) { for( 阅读全文
posted @ 2018-07-27 07:18 SWHsz 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 一开始以为是01分数规划,后来发现不知道怎么写。 发现只需要关心S,T的连通性和最长边最小边,而且边又那么少,可以枚举。 cpp include include include include using namespace std; const int N=5005; int n,m,mn,mx, 阅读全文
posted @ 2018-07-27 07:15 SWHsz 阅读(125) 评论(0) 推荐(0) 编辑