![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
题解
平时练习题解
羊博士粉丝团代理团长
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #615 (Div. 3) E.Obtain a Permutation
题意:给你一个n*m的矩阵,你可以进行两种操作。将矩阵中任意一个数变为任意数。选择矩阵的一列所有数向上移一个位置。下图第一列就是进行了一次操作2最后通过最少的操作次数将矩阵变为下面这种形式:思路:只需要一列一列的考虑即可,每一列最小最终答案就是最小。选取一列遍历每个数,先判断这个数是否是这一行应该出现的数,如果是再判断距离它正确的位置需要移动几次,然后map记录这个次数加1,将一...原创 2020-02-11 12:55:25 · 93 阅读 · 0 评论 -
GCD & LCM Inverse(poj 2429)
题意:给出xxx和yyy的gcdgcdgcd和lcmlcmlcm,让你求出x+yx+yx+y最小的x,yx,yx,y思路:首先(xy)gcd=lcm\frac{(xy)}{gcd}=lcmgcd(xy)=lcm,可以构造xgcd×ygcd=lcmgcd\frac{x}{gcd}\times\frac{y}{gcd}=\frac{lcm}{gcd}gcdx×gcdy=gcdlcm,其中xg...原创 2020-02-09 12:43:44 · 217 阅读 · 0 评论 -
I. Distance(2018焦作区域赛)
I. Distancetime limit per test6.0 smemory limit per test1024 MBinputstandard inputoutputstandard outputThere are nn points on a horizontal line, labelled with 11 through nn from left to right...原创 2019-10-05 13:46:13 · 218 阅读 · 0 评论 -
Codeforces 1238 D:AB-string
题目传送门: AB-stringD. AB-stringtime limit per test2 secondsmemory limit per test256 megabytesThe string t1 t2…tk is good if each letter of this string belongs to at least one palindrome of length gre...原创 2019-10-12 17:33:02 · 214 阅读 · 0 评论 -
Codeforces Round #600 (Div. 2) C.Sweets Eating
Codeforces Round #600 (Div. 2) C.Sweets EatingTsumugi brought n delicious sweets to the Light Music Club. They are numbered from 1 to n, where the i-th sweet has a sugar concentration described by an...原创 2019-11-19 18:15:42 · 186 阅读 · 0 评论 -
Prime Test(poj 1811)
多组样例,给你一个整数n,判断是否是质数,是的话输出”Prime“,否则输出最小的因子。(2<=n<=254)(2<=n<=2^{54})(2<=n<=254)思路:这么大的范围显然线性筛和暴力分解都会超时,这时就要用到miller_rabin质数测试和pollard_rho大数分解了,首先通过miller_rabin判断是否是质数,然后再pollard_rh...原创 2020-02-09 11:39:30 · 553 阅读 · 0 评论