徐州赛区网络预赛 D Easy Math】的更多相关文章

题目链接:Easy Math 题目大意:给定\(n(1\leqslant n\leqslant 10^{12}),m(1\leqslant m\leqslant 2*10^{9})\),求\(\sum_{i=1}^{m}\mu (i\cdot n)\). 题解:废话少说,直接上公式 $$\mu(i\cdot n)=\left\{\begin{matrix}\mu(i)\cdot\mu(n) & gcd(i,n)==1\\ 0 & other\end{matrix}\right.$$ 设 $…
比赛快结束的适合看了一下D题,发现跟前几天刚刚做过的HDU 5728 PowMod几乎一模一样,当时特兴奋,结果一直到比赛结束都一直WA.回来仔细一琢磨才发现,PowMod这道题保证了n不含平方因子,而Easy Math却没有.只要加一条特判,这道题就过了. AC代码贴在下面.求莫比乌斯函数前缀和的那一部分是我当时在网上临时找的代码,向那位仁兄道谢. #include<bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int…
ACM-ICPC 2018 徐州赛区网络预赛 A.Hard to prepare 枚举第一个选的,接下来的那个不能取前一个的取反 \(DP[i][0]\)表示选和第一个相同的 \(DP[i][1]\)表示选和第一个取反的 \(DP[i][2]\)表示选其他的 状态转移方程直接看代码好了 //#pragma GCC optimize("O3") //#pragma comment(linker, "/STACK:1024000000,1024000000") #inc…
H.Ryuji doesn't want to study 27.34% 1000ms 262144K   Ryuji is not a good student, and he doesn't want to study. But there are n books he should learn, each book has its knowledge a[i]a[i]. Unfortunately, the longer he learns, the fewer he gets. That…
Mur loves hash algorithm, and he sometimes encrypt another one's name, and call him with that encrypted value. For instance, he calls Kimura KMR, and calls Suzuki YJSNPI. One day he read a book about SHA-256,which can transit a string into just 256 b…
传送门 题面: In a world where ordinary people cannot reach, a boy named "Koutarou" and a girl named "Sena" are playing a video game. The game system of this video game is quite unique: in the process of playing this game, you need to consta…
In a world where ordinary people cannot reach, a boy named "Koutarou" and a girl named "Sena" are playing a video game. The game system of this video game is quite unique: in the process of playing this game, you need to constantly fac…
262144K   Ryuji is not a good student, and he doesn't want to study. But there are n books he should learn, each book has its knowledge a[i]a[i]. Unfortunately, the longer he learns, the fewer he gets. That means, if he reads books from ll to rr, he…
262144K   Morgana is learning computer vision, and he likes cats, too. One day he wants to find the cat movement from a cat video. To do this, he extracts cat features in each frame. A cat feature is a two-dimension vector <x, y>. If xi​= xj​ and yi…
链接 https://nanti.jisuanke.com/t/31456 参考题解  https://blog.csdn.net/ftx456789/article/details/82590044 #include <bits/stdc++.h> #define pb push_back #define mp make_pair #define fi first #define se second #define all(a) (a).begin(), (a).end() #define…