![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
19级训练
文章平均质量分 94
xunber_
这个作者很懒,什么都没留下…
展开
-
I - Assigning to Classes CodeForces - 1300B
I - Assigning to ClassesReminder: the median of the array [a1,a2,…,a2k+1] of odd number of elements is defined as follows: let [b1,b2,…,b2k+1] be the elements of the array in the sorted order. Then median of this array is equal to bk+1.There are 2n stude原创 2020-07-11 18:31:23 · 137 阅读 · 0 评论 -
H - Non-zero CodeForces - 1300A
H - Non-zeroGuy-Manuel and Thomas have an array a of n integers [a1,a2,…,an]. In one step they can add 1 to any element of the array. Formally, in one step they can choose any integer index i (1≤i≤n) and do ai:=ai+1.If either the sum or the product of al原创 2020-07-11 18:22:34 · 128 阅读 · 0 评论 -
HPU算法协会公开课第二期: 【基础算法2】(快速幂+二分)
HPU算法协会公开课第二期: 【基础算法2】(快速幂+二分)快速幂板子二分查找模板A - Pseudoprime numbersFermat’s theorem states that for any prime number p and for any integer a > 1, ap = a (mod p). That is, if we raise a to the pth power and divide by p, the remainder is a. Some (but not原创 2020-05-25 19:59:05 · 1936 阅读 · 0 评论 -
HPU算法协会公开课第一期:【基础算法1】(STL 自定义sort 前缀和差分)
传送门(:https://vjudge.net/contest/374040#overview)A - 前m大的数还记得Gardon给小希布置的那个作业么?(上次比赛的1005)其实小希已经找回了原来的那张数表,现在她想确认一下她的答案是否正确,但是整个的答案是很庞大的表,小希只想让你把答案中最大的M个数告诉她就可以了。给定一个包含N(N<=3000)个正整数的序列,每个数不超过5000,对它们两两相加得到的N*(N-1)/2个和,求出其中前M大的数(M<=1000)并按从大到小的顺序排列原创 2020-05-17 22:08:06 · 1116 阅读 · 0 评论 -
19级算法训练赛第七场
19级算法训练赛第7场A - 程序设计:合并数字蒜头君得到了 n 个数,他想对这些数进行下面这样的操作,选出最左边的相邻的差的绝对值为 1 的两个数,只保留较小的数,删去较大的数,直到没有两个相邻的差的绝对值为 1 的数,问最多可以进行多少次这样的操作?输入格式输入第一行为一个整数 n(1 \leq n \leq 10^5)n(1≤n≤10 5),表示数字的总数第二行为 n个整数 x_1,x_2,…,x_n(0 \leq x_i \leq 10^9)x 1 ,x 2,…,x n (0≤x i ≤1原创 2020-05-14 22:41:50 · 4380 阅读 · 0 评论