返回顶部
上一页 1 ··· 8 9 10 11 12 13 14 15 16 下一页
摘要: https://www.acwing.com/problem/content/201/ 要注意这次的数论分块里面是有一个上界n的,对k进行分块的时候l和r都不能超过n。 cpp include using namespace std; typedef long long ll; ll s1(ll n 阅读全文
posted @ 2019-09-05 17:44 Inko 阅读(139) 评论(0) 推荐(0)
摘要: https://www.acwing.com/problem/content/258/ cpp include using namespace std; typedef long long ll; const int N = 600010; int trie[N 24][2], latest[N 2 阅读全文
posted @ 2019-09-05 17:22 Inko 阅读(117) 评论(0) 推荐(0)
摘要: ``` include define mid ((l+r) 1) using namespace std; typedef long long ll; const int MAXN = 200000 + 5; int T[MAXN], tcnt; int cnt[MAXN cnt[v] cnt[u] 阅读全文
posted @ 2019-09-05 16:55 Inko 阅读(97) 评论(0) 推荐(0)
摘要: https://codeforc.es/gym/102001 L Binary String 签到题,给一个ll范围内的整数K,以及一个二进制串S,求从S中移除尽可能少的字符使得S表示的数不超过K。 思路:贪心+dfs,首先优先移除最高位的1,假如移除这个1之后不会导致前导零出现,这样是最优的。否则 阅读全文
posted @ 2019-09-04 23:03 Inko 阅读(481) 评论(0) 推荐(0)
摘要: 一开始在搞什么贪心,其实这个数据量就应该是搜索。先确定中心点的位置有至多49个,而其中状态不能确定的只有25个。在搜索到已经被覆盖的状态时直接往下一步走就可以了。 cpp include using namespace std; typedef long long ll; int n, m; cha 阅读全文
posted @ 2019-09-04 12:23 Inko 阅读(370) 评论(0) 推荐(0)
摘要: 质数筛 cpp const int MAXN = 1e7; int p[MAXN], ptop; void sieve(int n) { for(int i = 2; i 阅读全文
posted @ 2019-09-03 00:09 Inko 阅读(112) 评论(0) 推荐(0)
摘要: https://www.acwing.com/problem/content/222/ 求n以内gcd为质数的数对个数。 其实要是n和m不一样的话,貌似是要下面这样做的。也就是n和m不一样可能都得反演,下面这个是nlogn左右的,瓶颈在于给每个T刷上他的质因子p对应的mu[T/p]。 include 阅读全文
posted @ 2019-09-02 22:57 Inko 阅读(187) 评论(0) 推荐(0)
摘要: https://www.acwing.com/problem/content/232/ 错位排列: 阅读全文
posted @ 2019-09-02 21:48 Inko 阅读(173) 评论(0) 推荐(1)
摘要: B. super_log https://nanti.jisuanke.com/t/41299 很容易推出来是一个连续的幂次。这里主要是要知道扩展欧拉定理对互质肯定也是生效的,不需要整这么多东西。 D. Robots https://nanti.jisuanke.com/t/41301 这个题目的D 阅读全文
posted @ 2019-09-01 19:33 Inko 阅读(165) 评论(0) 推荐(0)
摘要: https://codeforc.es/gym/101461 5题结束了,可能是只打了3个小时吧。要是E试试Java8去用高精浮点二分,或者坚持读下来发现F是个割点模板题?以后可能远古场还是不打了,要拉2015年以内的。 D City Game 悬线法求最大非1子矩阵,根据up[i][j]=(g[i 阅读全文
posted @ 2019-09-01 09:37 Inko 阅读(288) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12 13 14 15 16 下一页