自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(357)
  • 收藏
  • 关注

转载 可持久化线段树

题目#include <iostream>#include <cstdio>#include <cstring>using namespace std;const int MAXN = 100009;int n, q, cnt, sz, Max[MAXN * 20], T[MAXN * 20], ls[MAXN * 20],...

2018-05-15 22:07:00 191

转载 矩阵快速幂

struct Matrix{ int mm[3][3]; Matrix() { memset(mm, 0, sizeof(mm)); } void init(){ for (int i = 0; i < 3; ++i) for (int j = 0; j < 3; ++j) mm[i][j] =...

2018-04-10 16:56:00 186

转载 标记永久化线段树 区间更新求和

#include <iostream>#include <cstdio>#include <cstring>using namespace std;typedef long long ll;const int MAXN = 100009;int n, q;ll sum[MAXN * 4], add[MAXN * 4];...

2018-04-10 16:55:00 206

转载 莫队基础

//http://www.spoj.com/problems/DQUERY/#include <iostream>#include <cstdio>#include <algorithm>#include <cmath>#include <cstring>using namespace std;c...

2018-04-10 16:53:00 121

转载 HDU 6006 状压dp

Engineer AssignmentTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 849Accepted Submission(s): 301Problem DescriptionIn Google, th...

2017-12-13 17:28:00 109

转载 HDU 6249

Alice’s StampsTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 125Accepted Submission(s): 34Problem DescriptionAlice likes to coll...

2017-12-12 16:09:00 92

转载 bzoj 2818

2818: GcdTime Limit:10 SecMemory Limit:256 MBSubmit:6814Solved:3005[Submit][Status][Discuss]Description给定整数N,求1<=x,y<=N且Gcd(x,y)为素数的数对(x,y)有多少对.Input一个整数N...

2017-12-09 10:07:00 100

转载 bzoj 2809

2809: [Apio2012]dispatchingTime Limit:10 SecMemory Limit:128 MBSubmit:4519Solved:2329[Submit][Status][Discuss]Description在一个忍者的帮派里,一些忍者们被选中派遣给顾客,然后依据自己的工作获取报偿。在这个帮派里,有一名忍者被称之为...

2017-12-08 16:33:00 96

转载 UVALive 7505 Hungry Game of Ants (2015Ecfinal)

题意:长度是n的线段上点的编号从1~n,每个点有一只蚂蚁蚂蚁的体重等于该点的编号,最初每只蚂蚁可以选择向右走或者向左走两只蚂蚁相遇时体重大的吃掉体重小的并且体重增加为两只的体重和,走到边界时掉头,问第k只蚂蚁活到最后的方案数。Limits: • 1 ≤ T ≤ 100. • 1 ≤ K ≤ N. • 2 ≤ N ≤ 106 .Sample Input32 13 2...

2017-12-06 16:58:00 169

转载 UVAL 7902 2016ECfinal F - Mr. Panda and Fantastic Beasts

题意:给出n个串,求一个最短的第一个串的子串使它不在其他的n-1个串中出现,若有多个求字典序最小的。Limits: • 1 ≤ T ≤ 42. • 2 ≤ N ≤ 50000. • N ≤ S1 + S2 + · · · + SN ≤ 250000. • the sum of Si in all test cases doesn’t exceed 3 × 106 .Sampl...

2017-12-04 13:29:00 112

转载 HDU 6230

PalindromeTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 433Accepted Submission(s): 168Problem DescriptionAlice like strings, ...

2017-12-02 19:04:00 106

转载 hdu 3068

最长回文Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 24799Accepted Submission(s): 9148Problem Description给出一个只由小写英文字符a,b,c...y,z组成...

2017-12-01 22:21:00 88

转载 HDU 6231

K-th NumberTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 599Accepted Submission(s): 234Problem DescriptionAlice are given an ...

2017-12-01 21:51:00 122

转载 bzoj 2243

2243: [SDOI2011]染色Time Limit:20 SecMemory Limit:512 MBSubmit:8800Solved:3305[Submit][Status][Discuss]Description给定一棵有n个节点的无根树和m个操作,操作有2类:1、将节点a到节点b路径上所有点都染成颜色c;2、询问节点a到节点b路径...

2017-12-01 20:17:00 126

转载 bzoj 2005

2005: [Noi2010]能量采集Time Limit:10 SecMemory Limit:552 MBSubmit:4379Solved:2615[Submit][Status][Discuss]Description栋栋有一块长方形的地,他在地上种了一种能量植物,这种植物可以采集太阳光的能量。在这些植物采集能量后,栋栋再使用一个能量汇集机...

2017-11-30 22:09:00 76

转载 bzoj 2120

2120: 数颜色Time Limit:6 SecMemory Limit:259 MBSubmit:6430Solved:2562[Submit][Status][Discuss]Description墨墨购买了一套N支彩色画笔(其中有些颜色可能相同),摆成一排,你需要回答墨墨的提问。墨墨会像你发布如下指令: 1、 Q L R代表询问你从第L支画笔到...

2017-11-25 21:36:00 103

转载 bzoj 2002

2002: [Hnoi2010]Bounce 弹飞绵羊Time Limit:10 SecMemory Limit:259 MBSubmit:12203Solved:6162[Submit][Status][Discuss]Description某天,Lostmonkey发明了一种超级弹力装置,为了在他的绵羊朋友面前显摆,他邀请小绵羊一起玩个游戏。游戏一...

2017-11-25 13:26:00 98

转载 bzoj 1257

1257: [CQOI2007]余数之和sumTime Limit:5 SecMemory Limit:162 MBSubmit:5071Solved:2345[Submit][Status][Discuss]Description给出正整数n和k,计算j(n, k)=k mod 1 + k mod 2 + k mod 3 + … + k mod n的...

2017-11-25 12:44:00 98

转载 codeforces.com/contest/251/problem/C

C. Number Transformationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Petya likes positive i...

2017-11-23 20:44:00 115

转载 bzoj 刷题计划~_~

bzoj 2818两个互质的数的gcd=1,所以他们同时乘一个素数那么他们的gcd=这个素数,所以枚举素数p找n/p以内有多少对互质数,用欧拉函数。bzoj 2809 可并堆,对于每一个子树显然是选花费小的节点合算,维护一个大根堆,并且当堆的花费和大于m时删掉堆根。bzoj 2243 树剖线段树区间染色查询区间颜色段数量,树剖之后还要考虑两段衔接之后颜色段是否减少。...

2017-11-14 17:06:00 148

转载 bzoj 1503

1503: [NOI2004]郁闷的出纳员Time Limit:5 SecMemory Limit:64 MBSubmit:12311Solved:4399[Submit][Status][Discuss]DescriptionOIER公司是一家大型专业化软件公司,有着数以万计的员工。作为一名出纳员,我的任务之一便是统计每位员工的工资。这本来是一份不错...

2017-11-13 21:22:00 84

转载 bzoj 1193 贪心+bfs

1193: [HNOI2006]马步距离Time Limit:10 SecMemory Limit:162 MBSubmit:2015Solved:914[Submit][Status][Discuss]Description在国际象棋和中国象棋中,马的移动规则相同,都是走“日”字,我们将这种移动方式称为马步移动。如图所示,从标号为 0 的点...

2017-11-12 21:15:00 90

转载 bzoj 1798 线段树

1798: [Ahoi2009]Seq 维护序列seqTime Limit:30 SecMemory Limit:64 MBSubmit:7163Solved:2587[Submit][Status][Discuss]Description老师交给小可可一个维护数列的任务,现在小可可希望你来帮他完成。 有长为N的数列,不妨设为a1,a2,…,aN 。有如下...

2017-11-12 21:11:00 61

转载 Codeforces 804D Expected diameter of a tree

D. Expected diameter of a treetime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPasha is a good stude...

2017-11-11 10:27:00 133

转载 bzoj 1208

1208: [HNOI2004]宠物收养所Time Limit:10 SecMemory Limit:162 MBSubmit:9775Solved:3918[Submit][Status][Discuss]Description最近,阿Q开了一间宠物收养所。收养所提供两种服务:收养被主人遗弃的宠物和让新的主人领养这些宠物。每个领养者都希望领养到自己满...

2017-11-09 21:32:00 60

转载 bzoj 3224

3224: Tyvj 1728 普通平衡树Time Limit:10 SecMemory Limit:128 MBSubmit:16656Solved:7255[Submit][Status][Discuss]Description您需要写一种数据结构(可参考题目标题),来维护一些数,其中需要提供以下操作:1. 插入x数2. 删除x数(若有多个相同的数...

2017-11-09 21:31:00 78

转载 HDU 5115 区间dp

Dire WolfTime Limit: 5000/5000 MS (Java/Others)Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 2877Accepted Submission(s): 1712Problem DescriptionDire wolves, also k...

2017-11-02 11:47:00 131

转载 hihocoder #1162 矩阵加速dp

#1162 : 骨牌覆盖问题·三时间限制:10000ms单点时限:1000ms内存限制:256MB描述前两周里,我们讲解了2xN,3xN骨牌覆盖的问题,并且引入了两种不同的递推方法。这一次我们再加强一次题目,对于给定的K和N,我们需要去求KxN棋盘的覆盖方案数。提示:KxN骨牌覆盖输入第1行:2个整数N。表示棋盘宽度为k,长...

2017-10-26 19:53:00 97

转载 分块入门

洛谷 2068题目描述给定一个长度为n(n<=100000),初始值都为0的序列,x(x<=10000)次的修改某些位置上的数字,每次加上一个数,然后提出y (y<=10000)个问题,求每段区间的和。时间限制1秒。输入输出格式输入格式:第一行1个数,表示序列的长度n第二行1个数,表示操作的次数w后面依次是w行,分别表示加入和询问操作...

2017-10-19 20:48:00 82

转载 bzoj 1036 树链剖分

1036: [ZJOI2008]树的统计CountTime Limit:10 SecMemory Limit:162 MBSubmit:18993Solved:7748[Submit][Status][Discuss]Description  一棵树上有n个节点,编号分别为1到n,每个节点都有一个权值w。我们将以下面的形式来要求你对这棵树完成一些操作:...

2017-10-19 09:21:00 68

转载 spoj 375 树链剖分 模板

QTREE - Query on a tree#treeYou are given a tree (an acyclic undirected connected graph) withNnodes, and edges numbered 1, 2, 3...N-1.We will ask you to perfrom some instructions...

2017-10-18 21:26:00 92

转载 HDU 2825 AC自动机+DP

Wireless PasswordTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7250Accepted Submission(s): 2384Problem DescriptionLiyuan lives ...

2017-10-16 18:53:00 81

转载 lightoj 1205 数位dp

1205 - Palindromic NumbersPDF (English)StatisticsForumTime Limit:2 second(s)Memory Limit:32 MBA palindromic number or numeral palindrome is a ...

2017-10-15 21:13:00 137

转载 HDU 3271 数位dp+二分

SNIBBTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1485Accepted Submission(s): 435Problem DescriptionAs we know, some numbers...

2017-10-15 21:08:00 102

转载 HDU 3943 数位dp+二分

K-th Nya NumberTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 125536/65536 K (Java/Others)Total Submission(s): 3155Accepted Submission(s): 1021Problem DescriptionArcueid likes ...

2017-10-15 21:05:00 79

转载 poj 3685 二分

MatrixTime Limit:6000MSMemory Limit:65536KTotal Submissions:7415Accepted:2197DescriptionGiven aN×Nmatrix A, whose element in thei-th row andj-th ...

2017-10-12 10:36:00 65

转载 poj 3415 后缀数组 两个字符串中长度不小于 k 的公共子串的个数

Common SubstringsTime Limit:5000MSMemory Limit:65536KTotal Submissions:11469Accepted:3796DescriptionA substring of a stringTis defined as:T(i,k...

2017-10-02 12:25:00 98

转载 poj 3294 后缀数组 多字符串中不小于 k 个字符串中的最长子串

Life FormsTime Limit:5000MSMemory Limit:65536KTotal Submissions:16223Accepted:4763DescriptionYou may have wondered why most extraterrestrial life forms...

2017-10-02 11:12:00 112

转载 poj 2774 后缀数组 两个字符串的最长公共子串

Long Long MessageTime Limit:4000MSMemory Limit:131072KTotal Submissions:31904Accepted:12876Case Time Limit:1000MSDescriptionThe little cat is majo...

2017-10-01 21:43:00 151

转载 poj 3693 后缀数组 重复次数最多的连续重复子串

Maximum repetition substringTime Limit:1000MSMemory Limit:65536KTotal Submissions:10612Accepted:3277DescriptionThe repetition number of a string is def...

2017-10-01 21:32:00 86

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除