ACM-ICPC 2018 南京赛区网络预赛部分题解

版权声明:欢迎转载 https://blog.csdn.net/animalcoder/article/details/82775193

5题顺利进现场

A 签到

链接:https://nanti.jisuanke.com/t/30990

思路:打表找规律即可

L 最短路

链接:https://nanti.jisuanke.com/t/31001

队友秒过,听说是BZOJ原题,改为有向图

J 线性筛 / 分块打表

链接:https://nanti.jisuanke.com/t/30999

思路:打表OEIS http://oeis.org/A007427

\large f(n)=|\sum_{d|n}\mu(d)*\mu(n/d) |,ans=f(n)的前缀和

线性筛:

i%pj!=0,\large f(i*p_j)=f(i)*f(p_j)

pj为质数,\large f(p_j)=-2

i%pj==0且i/pj%pj !=0,\large f(i*p_j)=f(i/p_j),此时i有1个pj质因子

i%pj==0且i/pj%pj ==0,\large f(i*p_j)=0,此时i有2个及以上pj质因子

你想,如果i*pj 由2个pj质因子组成,那么肯定一边分配一个pj,

答案就跟i/pj是一样的,

同理,如果i*pj 由3个pj质因子组成,那么不管pj怎么分配答案都是0

E

链接:https://nanti.jisuanke.com/t/30994

思路:队友过的,听说是壮压DP裸题

B.

链接:https://nanti.jisuanke.com/t/30991

单调栈+DP+数学,CFgym原题,秒过

需要补题

G题(线段树/262)

C题(大模拟/208)

D题(计算几何--半平面交/65)

I题(回文树/251),队友已补

K题(博弈+异或+DP/69)

猜你喜欢

转载自blog.csdn.net/animalcoder/article/details/82775193