摘要: 可以发现:f[i]转移到f[i+1]只和最后一串1的长度和平方有关,因为如果新加的位置是1,贡献就是(x+1)^3-x^3=3x^2+3x+1,否则为0;所以对于每一个位置,处理出期望的f,x和x^2(x表示最后一串1的长度)即可#include#define N 1... 阅读全文
posted @ 2017-07-22 14:03 Ren_Ivan 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 莫队大法好,入坑保平安只要能O(1)或O(log)转移,离线莫队貌似真的无敌。#include#include#include#include#include#define N 50005using namespace std;int n,m,nn,tot,c[N],... 阅读全文
posted @ 2017-07-22 14:03 Ren_Ivan 阅读(84) 评论(0) 推荐(0) 编辑
摘要: 基本思路和蒲公英一样还是预处理出每两个块间的答案询问时暴力跑两边的贡献#include#include#include#include#include#include#include#define N 100005using namespace std;int n,m... 阅读全文
posted @ 2017-07-22 14:03 Ren_Ivan 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 又下雨了一下雨就不想学习了下得好大好大感觉自己好渺小啊一个人这一生又能干点什么呢??何必呢?不必强颜欢笑,不必装虚作假Be yourself , do the best.And you'll never regret.Life isn't about waiting ... 阅读全文
posted @ 2017-07-22 14:02 Ren_Ivan 阅读(172) 评论(0) 推荐(0) 编辑