摘要: 随机化数组的方法 来源于Problem - B - Codeforces (Unofficial mirror site, accelerated for Chinese users) 当时用随机化数组的方法过了,记录一下,以后可能用到 #include<bits/stdc++.h> using n 阅读全文
posted @ 2021-07-26 22:18 1427314831a 阅读(77) 评论(1) 推荐(0) 编辑
摘要: 2021牛客暑期多校训练营2 J Product of GCDs 思路就是每个数拆成质因数,再从每个质数以及它的次幂去扫一遍所有的数,每次取质数的组合数次幂作为贡献,累乘起来即为最后的结果 记录一下这次调试的过程 开始时考虑用vector去存每一个质数所对应的信息,每次用vector的大小与k进行比 阅读全文
posted @ 2021-07-23 14:01 1427314831a 阅读(59) 评论(0) 推荐(0) 编辑
摘要: Harbour.Space Scholarship Contest 2021-2022 (open for everyone, rated, Div. 1 + Div. 2) Pairwise Modulo You have an array a consisting of n distinct p 阅读全文
posted @ 2021-07-23 11:43 1427314831a 阅读(114) 评论(0) 推荐(1) 编辑
摘要: 2021“MINIEYE杯”中国大学生算法设计超级联赛(1)1004 Another thief in a Shop A thief made his way to a shop. There are n kinds of products in the shop and an infinite n 阅读全文
posted @ 2021-07-21 22:46 1427314831a 阅读(153) 评论(0) 推荐(1) 编辑
摘要: 2021牛客多校第一场H Hash Function 题意 \[ 给定一个有n项的数列a,选定一个最小的seed使得用其构造的hash不会冲突,其中H_{seed}(x)=x\ mod\ seed\\ 数据范围1\le n\le 500000,\forall 0\le i< j<n,a_i\neq 阅读全文
posted @ 2021-07-21 11:14 1427314831a 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 2021“MINIEYE杯”中国大学生算法设计超级联赛(1)1007 Pass! hdu6956 There are n players passing ball on the football field. Initially, the first player has the ball. The 阅读全文
posted @ 2021-07-20 22:25 1427314831a 阅读(121) 评论(0) 推荐(0) 编辑