2021年7月18日

2021牛客暑期多校训练营1 H.Hash Function

摘要: https://ac.nowcoder.com/acm/contest/11166/H 题意: 给n个数,让你找出一个最小的正整数m满足:这n个数%m得到的值各不相同。0<=a[i]<=500000。1<=n<=500000。 官方题解: 两个数a,b。若他们%m后余数相同,则a%m=b%m,可得( 阅读全文

posted @ 2021-07-18 16:45 Aminers 阅读(120) 评论(0) 推荐(0) 编辑

2021年7月14日

2020牛客暑期多校训练营(第二场)G. Greater and Greater

摘要: https://ac.nowcoder.com/acm/contest/5667/G 题目描述:给长为n的数组a,和长为m的数组b。问a中有多少个长为m的连续的子数组s满足:s[i]>=b[i],i∈[1,m]。 官方题解如上,接下来结合我的理解解释一下: 题解的s数组不难理解,s[i][j]=1就 阅读全文

posted @ 2021-07-14 11:13 Aminers 阅读(38) 评论(0) 推荐(0) 编辑

2021年5月4日

2017 Chinese Multi-University Training, BeihangU Contest F. Function

摘要: F. Functiontime limit per test1 secondmemory limit per test128 megabytesinputstandard inputoutputstandard outputYou are given a permutation a obtained 阅读全文

posted @ 2021-05-04 22:57 Aminers 阅读(101) 评论(0) 推荐(0) 编辑

2021年4月28日

P3211 [HNOI2011]XOR和路径 (拆位+高斯消元)

摘要: https://www.luogu.com.cn/problem/P3211 题目描述 给定一个无向连通图,其节点编号为 1 到 N,其边的权值为非负整数。试求出一条从 1 号节点到 N 号节点的路径,使得该路径上经过的边的权值的“XOR 和”最大。该路径可以重复经过某些节点或边,当一条边在路径中出 阅读全文

posted @ 2021-04-28 20:10 Aminers 阅读(46) 评论(0) 推荐(0) 编辑

2021年4月26日

P2973 [USACO10HOL]Driving Out the Piggies G(高斯消元求期望)

摘要: https://www.luogu.com.cn/problem/P2973 题目描述:一个无向图,节点1有一个炸弹,在每个单位时间内,有p/q的概率在这个节点炸掉,有1-p/q的概率随机选择一条出去的路到其他的节点上。问最终炸弹在每个节点上爆炸的概率。 搬运洛谷的题解:https://siyuan 阅读全文

posted @ 2021-04-26 14:11 Aminers 阅读(75) 评论(0) 推荐(0) 编辑

2021年4月24日

P2962 [USACO09NOV]Lights G

摘要: https://www.luogu.com.cn/problem/P2962 题目描述 给出一张 n 个点 m 条边的无向图,每个点的初始状态都为 0。 你可以操作任意一个点,操作结束后所有相邻的端点的状态都会改变,由 0 变成 1 或由 1 变成 0。 你需要求出最少的操作次数,使得在所有操作完成 阅读全文

posted @ 2021-04-24 23:54 Aminers 阅读(148) 评论(0) 推荐(0) 编辑

2021年3月30日

Codeforces Round #708 (Div. 2) E2. Square-free division (hard version)

摘要: E2. Square-free division (hard version) This is the hard version of the problem. The only difference is that in this version 0≤k≤20. There is an array 阅读全文

posted @ 2021-03-30 19:01 Aminers 阅读(98) 评论(0) 推荐(0) 编辑

2021年3月28日

2021年广东工业大学第十五届文远知行杯程序设计竞赛(题解

摘要: A M形字符串: 判断回文,字符串是否相同,都可以采用字符串哈希O(1)判断。 题目要计算的是前缀也就是确定了左端点1,所以枚举右端点i。判断1~i (后面这种形式都是表示L-R的字符串子串) 是不是回文,如果是回文,就可以在他下一位置i+1~i+i是不是和1~i相同,如果是那就可以拼成一个M字符串 阅读全文

posted @ 2021-03-28 21:11 Aminers 阅读(128) 评论(0) 推荐(0) 编辑

2021年3月26日

Codeforces Round #709 (Div. 2, based on Technocup 2021 Final Round) E. Skyline Photo

摘要: 题目链接:https://codeforces.com/contest/1484/problem/E E. Skyline Photo Alice is visiting New York City. To make the trip fun, Alice will take photos of t 阅读全文

posted @ 2021-03-26 00:18 Aminers 阅读(101) 评论(0) 推荐(0) 编辑

2021年2月25日

P3235 [HNOI2014]江南乐 (整数分块+sg)

摘要: P3235 [HNOI2014]江南乐 https://www.luogu.com.cn/problem/P3235 题目描述 小A是一个名副其实的狂热的回合制游戏玩家。在获得了许多回合制游戏的世界级奖项之后,小A有一天突然想起了他小时候在江南玩过的一个回合制游戏。 游戏的规则是这样的,首先给定一个 阅读全文

posted @ 2021-02-25 16:17 Aminers 阅读(61) 评论(0) 推荐(0) 编辑

导航