摘要: A题: https://www.nowcoder.com/acm/contest/185/A 链接:https://www.nowcoder.com/acm/contest/185/A来源:牛客网 题目描述 给出一个二元组(A,B) 求出无序二元组(a,b) 使得(a|A,b|B)的组数 无序意思就 阅读全文
posted @ 2018-09-08 20:05 过路人1998 阅读(555) 评论(0) 推荐(0) 编辑
摘要: 公式: 阅读全文
posted @ 2018-09-08 18:58 过路人1998 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 公式: N! ~= sqrt(2 * PI * n) * ((n / e) ^n) 题目类型不慌都. 阅读全文
posted @ 2018-09-08 18:57 过路人1998 阅读(444) 评论(0) 推荐(0) 编辑
摘要: class Matrix { public: int r, c; ll mat[32][32]; ll *operator [] (int x) { return mat[x]; } Matrix operator * (const Matrix &a) const { Matrix res; res.r = r... 阅读全文
posted @ 2018-09-07 11:30 过路人1998 阅读(101) 评论(0) 推荐(0) 编辑
摘要: class pal { public: int next[maxn][26]; int fail[maxn]; char str[maxn]; int len[maxn]; int last; int tot; int n; // 记录节点长度,同时返回一个节点 inline int node(int _len)... 阅读全文
posted @ 2018-09-06 11:58 过路人1998 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 回文串 HYSBZ - 3676 考虑一个只包含小写拉丁字母的字符串s。我们定义s的一个子串t的“出 现值”为t在s中的出现次数乘以t的长度。请你求出s的所有回文子串中的最 大出现值。 建一颗回文树,然后getans统计答案就OK了. (回文树见IOI2017论文) 阅读全文
posted @ 2018-09-06 11:57 过路人1998 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Hand in Hand HDU - 3926 给一一副有单环或链的图 判断是否同构 我们可以判断环有多少个,链有多少个,同时判断一下每个环的点数和链的点的个数 第一种做法: 所以,我们可以直接用并查集来做. 同时,我们注意到两幅图的人数应该是一样的. 所以,把并查集修改一下就直接判断了. (如果成 阅读全文
posted @ 2018-09-01 21:48 过路人1998 阅读(447) 评论(0) 推荐(0) 编辑
摘要: A题 An Olympian Math Problem: 求S(n) = 1*1! + 2*2! + 3*3! + 4*4! + ... + (n-1)*(n-1)! 链接: https://nanti.jisuanke.com/t/30990 所以直接输出n-1完事 #include <bits/ 阅读全文
posted @ 2018-09-01 21:06 过路人1998 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Tarjan 阅读全文
posted @ 2018-08-30 00:05 过路人1998 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 附上一般讲得不错的博客 https://blog.csdn.net/lw277232240/article/details/73251092 https://www.cnblogs.com/collectionne/p/6847240.html https://blog.csdn.net/zhn_6 阅读全文
posted @ 2018-08-30 00:04 过路人1998 阅读(246) 评论(0) 推荐(0) 编辑