摘要: 显然题目要我们求 $2\sum_{i=1}^N \sum_{j=1}^M (i,j) NM$ 即 $2\sum_{i=1}^{\min(N,M)} \phi(i)\lfloor \frac{N}{i} \rfloor \lfloor \frac{M}{i} \rfloor NM$ 线筛+前缀和+整除 阅读全文
posted @ 2018-12-06 21:28 A·H 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 树状数组维护前缀最大值+扫描线DP cpp include"cstdio" include"cstring" include"iostream" include"algorithm" using namespace std; const int MAXN=1e5+5; int n,m,c,maxn; 阅读全文
posted @ 2018-12-06 20:04 A·H 阅读(168) 评论(0) 推荐(0) 编辑