摘要: https://ac.nowcoder.com/acm/contest/44042/A (暴力的链表并查集) https://atcoder.jp/contests/abc269/tasks/abc269_c (01序列的01子集)C. Submask https://atcoder.jp/cont 阅读全文
posted @ 2022-10-28 00:05 er007 阅读(45) 评论(0) 推荐(0) 编辑
摘要: 入门指南题面: 洛谷题面: 观看的题解:https://www.cnblogs.com/jerryRey/p/4622927.html 对样例区样例画的一些图: 题目的一些争议: bfs[u] + 1 == bfs[b] && v < u的情况被默认看作后兄弟节点 // 代码 //#define i 阅读全文
posted @ 2022-12-06 22:51 er007 阅读(15) 评论(0) 推荐(0) 编辑
摘要: V<int> dis; // 离散化数组 V<int> l(n), r(n); for (int i = 0; i < n; i++) { cin >> l[i] >> r[i]; dis.push_back(l[i]), dis.push_back(r[i]); } // 离散化 sort(all 阅读全文
posted @ 2022-11-15 14:48 er007 阅读(12) 评论(0) 推荐(0) 编辑
摘要: https://www.acwing.com/solution/content/23435/ https://oiwiki.org/math/game-theory/impartial-game/ https://ac.nowcoder.com/acm/contest/26656/1048 http 阅读全文
posted @ 2022-11-11 14:05 er007 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 题意: 有多少种 x y 的选择方法,使得对于长度为 n 的 a 数组, 取 a[x+1] ,a[x+2] ... a[y-2] , a[y-1] 的乘积是 k 的倍数 思路: 对于所有的 x ,当选择 x = x + 1 时 y = y 满足条件 ,则此时取 x = x ,y = y 也满足条件 阅读全文
posted @ 2022-11-10 23:18 er007 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 链接:https://ac.nowcoder.com/acm/contest/35146/B来源:牛客网 题目描述 There is a kingdom that has nnn cities connected by n−1n-1n−1 roads. All roads' length is 11 阅读全文
posted @ 2022-09-22 18:58 er007 阅读(18) 评论(0) 推荐(0) 编辑
摘要: https://codeforces.com/gym/103107/problem/A A. And RMQ time limit per test 3 seconds memory limit per test 512 megabytes input standard input output s 阅读全文
posted @ 2022-09-19 14:48 er007 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 链接:https://ac.nowcoder.com/acm/contest/28576/A来源:牛客网 题目描述 给出一个长度为n的字符串s和q个查询。对于每一个查询,会输入一个字符串t,你需要判断这个字符串t是不是s的子串。子串的定义就是存在任意下标a<b<c<d<e,那么”s[a]s[b]s[ 阅读全文
posted @ 2022-09-15 05:50 er007 阅读(43) 评论(0) 推荐(0) 编辑
摘要: https://codeforces.ml/contest/1729/problem/G https://zhuanlan.zhihu.com/p/563809110 分析: 就是把主串中所有跟子串匹配的位置删掉,问最少删除多少次能够满足主串中不再出现子串,并问满足最少删除次数的方案数有多少个 f[ 阅读全文
posted @ 2022-09-14 23:21 er007 阅读(84) 评论(0) 推荐(0) 编辑
摘要: https://codeforces.ml/contest/1729/problem/F 分析: 这题和数字根有关,数字根相当于base是10的字符串哈希(把整个处理出来,把前面*权值后删掉),只不过这个哈希值就是这一段值的大小,就可以用这个哈希值预处理出(l,r)范围内的数字根的大小 %9 满足分 阅读全文
posted @ 2022-09-14 01:24 er007 阅读(21) 评论(0) 推荐(0) 编辑