摘要: 题目描述:qn姐姐最好了~ qn姐姐给你了一个长度为n的序列还有m次操作让你玩, 1 l r 询问区间[l,r]内的元素和 2 l r 询问区间[l,r]内的元素的平方 和 3 l r x 将区间[l,r]内的每一个元素都乘上x 4 l ... 阅读全文
posted @ 2018-10-16 20:18 lu_nacy 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 小w不会离散数学,所以她van的图论游戏是送分的小w有一张n个点n-1条边的无向联通图,每个点编号为1~n,每条边都有一个长度小w现在在点x上她想知道从点x出发经过每个点至少一次,最少需要走多少路输入描述:第一行两个整数 n,x,代表点数,和小w所处的位置第二到第n行... 阅读全文
posted @ 2018-09-22 21:26 lu_nacy 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 第一种方法:暴力求解long long C[70][70];void pre(){ memset(C,0,sizeof(C)); for(int i=0;i<70;i++) for(int j=0;j<=i;j++) C... 阅读全文
posted @ 2018-09-18 21:07 lu_nacy 阅读(89) 评论(0) 推荐(0) 编辑
摘要: 彻底入门模板如下:int lowb(int t){ return t & (-t);}void add(int i,int v){ for( ;i 0;s += ar[i],i -= lowb(i)); return s;}例题:ACM-ICPC ... 阅读全文
posted @ 2018-09-09 21:50 lu_nacy 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 基础模板:#include#include#includeusing namespace std;const int inf = 0x3f3f3f3f;const int maxn = 1010;int n,m,x,ct;int g[maxn][maxn],gr[ma... 阅读全文
posted @ 2018-09-09 10:18 lu_nacy 阅读(155) 评论(0) 推荐(0) 编辑
摘要: A prime number (or a prime) is a natural number greater than 111 that cannot be formed by multiplying two smaller natural numbers. Now lets define a n 阅读全文
posted @ 2018-09-09 08:50 lu_nacy 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 51nod 1089 最长回文子串 V2(Manacher算法) 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题回文串是指aba、abba、cccbccc、aaaa这种左右对称的字符串。输入一个字符串Str,输出Str里最长回文子串的长度... 阅读全文
posted @ 2018-09-07 21:02 lu_nacy 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Computer simulations often require random numbers. One way to generate pseudo-random numbers is via a function of the form seed(x+1) = [seed(x) + STEP 阅读全文
posted @ 2018-08-21 20:50 lu_nacy 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 转载自:树的直径题目: Cow MarathonTime Limit: 2000MS Memory Limit: 30000K Total Submissions: 5325 Accepted: 2614 Case Time Limit: ... 阅读全文
posted @ 2018-08-18 22:24 lu_nacy 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Problem Description lcy gives a hard puzzle to feng5166,lwg,JGShining and Ignatius: gave a and b,how to know the a^b.everybody objects to this BT prob 阅读全文
posted @ 2018-08-18 18:18 lu_nacy 阅读(106) 评论(0) 推荐(0) 编辑