随笔分类 -  题解

摘要:原题:https://ac.nowcoder.com/acm/contest/889/D 题意: 给定大小为n( include include using namespace std; typedef long long ll; const ll maxn=1e6+5; struct node{ 阅读全文
posted @ 2019-08-15 18:56 UCPRER 阅读(182) 评论(0) 推荐(0)
摘要:原题:https://ac.nowcoder.com/acm/contest/889/E 思路: 做并查集,维护每个集合大小,初始化操作前的总方案数,每次合并两个集合时减少的数量=合并的两个集合大小相乘, 再乘以从其他集合中选出2个不在一个集合内的方案数。 从其他集合中选出2个不在一个集合内的方案数 阅读全文
posted @ 2019-08-15 18:48 UCPRER 阅读(154) 评论(0) 推荐(0)
摘要:原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=6534 题意: 给你一个数组,对于第i个数来说,如果存在一个位置j,使得j i并且a[j] k include include using namespace std; const int maxn=27 阅读全文
posted @ 2019-08-13 19:32 UCPRER 阅读(134) 评论(0) 推荐(0)
摘要:原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=6655 简单博弈问题,A,B手里各有n,m张牌,牌有颜色,两人轮流出牌(A先出),一个人只能打出对放未打出过的颜色的牌(可以打出自己打出过的颜色的牌),当一方不能再打出牌时,对方获胜。 博弈策略:优先选择 阅读全文
posted @ 2019-08-13 13:08 UCPRER 阅读(176) 评论(0) 推荐(0)