看看type = 2的操作,对于区间[l,r]内的元素对x取模,由于取模肯定不能和取模,所以只能每个元素取模,看上去不是区间更新,但是仔细一看,若区间[l,r]内所有的元素都小于x,那么这一区间不需要管,所以还是存在区间整段操作,所以需要lazy,这里也算是一个剪枝了,剩下的就是type = 3的 单点更新,还有type = 1的区间求和,整体操作不难
int n,m;
ll nnum...
分类:
其他好文 时间:
2014-09-02 22:58:35
阅读次数:
423
根据提示便知是权限问题,用下面的命令查询objects下有root权限的文件ll .git/objects/ | grep rootdrwxr-xr-x 2 root root 4096 3月 1 21:40 3ddrwxr-xr-x 2 root root 4096 3月 1 21:4...
分类:
数据库 时间:
2014-09-02 21:22:25
阅读次数:
261
In this article I'll discuss the most fundamental technique in concurrent programming known as memory barriers, or fences, that make
the memory state within a processor visible to other processors.
...
分类:
其他好文 时间:
2014-09-02 12:29:24
阅读次数:
266
Problem Description
After repeated attempts, LL finds the greedy strategy is very awful in practice. Even there is no apparent evidence to proof it is better than a random one. So he has to drop th...
分类:
其他好文 时间:
2014-09-02 12:29:04
阅读次数:
226
大三目标把codeforces打成黄色以上!从div1下手,每次做前三道题。A一道简单的DP。#include#include#include#include#include#include#include#include#define LL long long#define MAXN 100005...
分类:
其他好文 时间:
2014-09-02 00:09:03
阅读次数:
295
题目:点击打开链接
题意:一个细胞自动机包含n个格子,每个格子的值都会变成它距离不超过d的所有格子的值,求最后的结果
思路:这个是循环矩阵,可以用O(n^2)的时间过掉
#include
#include
#include
#include
using namespace std;
typedef long long ll;
const int maxn = 505;
int n,...
分类:
其他好文 时间:
2014-09-01 21:12:33
阅读次数:
165
题目链接:点击打开链接
题意:
给定n长的序列
下面2个操作
0 x y 给[x,y]区间每个数都 sqrt
1 x y 问[x, y] 区间和
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define ll long long...
分类:
其他好文 时间:
2014-09-01 10:47:03
阅读次数:
223
If your developing a new Windows 8 app and you want to test it on another device (e.g. Surface), you’ll need to use a technique called sideloading. Th...
分类:
移动开发 时间:
2014-09-01 09:14:32
阅读次数:
283
设备文件:b:按块为单位,随机访问的设备如:硬盘c:按字符为单位,线性设备如:键盘[root@localhosttm]#ll/dev/crw-rw----1rootaudio14,12Feb1800:28adspbrw-rw----1rootfloppy2,0Feb1800:28fd014,12和2,0分别表示主设备号标识设备类型次设备号标识同一种类型中不同的设备mkn..
分类:
系统相关 时间:
2014-08-31 18:46:52
阅读次数:
203
题目链接:点击打开链接
#include
#include
#include
#include
#include
using namespace std;
#define N 300100
#define mod 1000000007
typedef long long ll;
ll dp[N][2];
//dp[i][1]表示i点已经归属于某个黑点的方法数
//dp[i][...
分类:
移动开发 时间:
2014-08-30 23:11:50
阅读次数:
438