太难了

P1865 A % B Problem

@[liqiqi](/space/show?uid=210451) emmm能不要问一次做一次,先预处理好吗
by    吾皇 @ 2019-08-08 20:12:44


@[   吾皇](/space/show?uid=136601) 我就问了一次。。。实在不太懂
by liqiqi @ 2019-08-08 20:17:02


...不是这个意思,我是说先把质数个数预处理好用类似前缀和的方式存储,对于每一个满足要求的区间l,r,输出f[r]-f[l-1]
by    吾皇 @ 2019-08-08 20:20:28


我指的询问是l、r的输入...
by    吾皇 @ 2019-08-08 20:21:01


@[liqiqi](/space/show?uid=210451)
by    吾皇 @ 2019-08-08 20:23:20


素数筛啊
by HYSK_残雪 @ 2019-08-08 20:25:00


@[liqiqi](/space/show?uid=210451)
by HYSK_残雪 @ 2019-08-08 20:25:19


@[liqiqi](/space/show?uid=210451) 您的a数组也没必要开嫩个大,开到1e6就行了,反正r>m就continue了,m最大只有1e6(后面如果听从建议改成f数组也是一样)
by 天南月 @ 2019-08-08 20:26:04


@[HYSK_残雪](/space/show?uid=65671) 我这不是素数筛吗。。
by liqiqi @ 2019-08-08 20:38:29


@[   吾皇](/space/show?uid=136601) 好的。我去改改
by liqiqi @ 2019-08-08 20:38:58


| 下一页