自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

天翼之城的博客

菜鸟的记录

  • 博客(97)
  • 收藏
  • 关注

原创 Run Away——模拟退火

Problem Description One of the traps we will encounter in the Pyramid is located in the Large Room. A lot of small holes are drilled into the floor. They look completely harmless at the first sight. ...

2018-08-31 09:44:29 714

原创 hdu 3518 Boring counting —— 后缀数组

Problem Description 035 now faced a tough problem,his english teacher gives him a string,which consists with n lower case letter,he must figure out how many substrings appear at least twice,moreover,...

2018-08-31 09:43:59 135

原创 Glad You Came hdu 6356 —— 线段树区间更新+剪枝

Problem Description Steve has an integer array a of length n (1-based). He assigned all the elements as zero at the beginning. After that, he made m operations, each of which is to update an interval...

2018-08-30 16:30:45 177

原创 Kth number —— 主席树

Problem Description Give you a sequence and ask you the kth big number of a inteval.Input The first line is the number of the test cases. For each test case, the first line contain two integer n...

2018-08-30 16:25:38 553

原创 Super Mario —— 求小于等于k值的个数

Problem Description Mario is world-famous plumber. His “burly” figure and amazing jumping ability reminded in our memory. Now the poor princess is in trouble again and Mario needs to save his lover. ...

2018-08-30 16:25:03 190

原创 To the moon——区间更新主席树

Background To The Moon is a independent game released in November 2011, it is a role-playing adventure game powered by RPG Maker. The premise of To The Moon is based around a technology that allows ...

2018-08-30 16:24:17 239

原创 SPOJ 3267 DQUERY——求区间内不重复值的个数

Given a sequence of n numbers a1, a2, …, an and a number of d-queries. A d-query is a pair (i, j) (1 ≤ i ≤ j ≤ n). For each d-query (i, j), you have to return the number of distinct elements in the su...

2018-08-30 16:23:26 497

原创 HYSBZ 3674: 可持久化并查集加强版——主席树+并查集

Description: 自从zkysb出了可持久化并查集后…… hzwer:乱写能AC,暴力踩标程 KuribohG:我不路径压缩就过了! ndsf:暴力就可以轻松虐! zky:……n个集合 m个操作 操作: 1 a b 合并a,b所在集合 2 k 回到第k次操作之后的状态(查询算作操作) 3 a b 询问a,b是否属于同一集合,是则输出1否则输出0 请注意本题采用强制在...

2018-08-30 16:22:36 173

原创 E - Groundhog Build Home HDU - 3932 模拟退火

Groundhogs are good at digging holes, their home is a hole, usually a group of groundhogs will find a more suitable area for their activities and build their home at this area .xiaomi has grown up, ca...

2018-08-30 16:16:35 202

原创 Knight Moves——双向宽搜初始值的赋法

下载LOFTER我的照片书 | DescriptionBackground Mr Somurolov, fabulous chess-gamer indeed, asserts that no one else but him can move knights from one position to another so fast. Can you beat him? The P...

2018-08-30 16:14:06 175

原创 hdu 6058 Kanade's sum 枚举

Problem Description Give you an array A[1..n]of length n. Let f(l,r,k) be the k-th largest element of A[l..r].Specially , f(l,r,k)=0 if r−l+1#include<bits/stdc++.h>using namespace std;#...

2018-08-30 13:09:56 129

原创 hdu 5726 GCD

Problem Description Give you a sequence of N(N≤100,000) integers :a1,...,an(0<ai≤1000,000,000)a1,...,an(0<ai≤1000,000,000) a1,...,an(0(l',r')(1≤l<r≤N)(l′,r′)(1≤l<r≤N)(l′,r′)(1≤la1,...,an(...

2018-08-30 10:56:05 230

原创 洛谷 P3384 【模板】树链剖分

题目描述 如题,已知一棵包含N个结点的树(连通且无环),每个节点上包含一个数值,需要支持以下操作:操作1: 格式: 1 x y z 表示将树从x到y结点最短路径上所有节点的值都加上z操作2: 格式: 2 x y 表示求树从x到y结点最短路径上所有节点的值之和操作3: 格式: 3 x z 表示将以x为根节点的子树内所有节点值都加上z操作4: 格式: 4 x 表示求以x为根节点的子树...

2018-08-28 18:47:19 145

原创 Relevant Phrases of Annihilation SPOJ - PHRASES —— 后缀数组

You are the King of Byteland. Your agents have just intercepted a batch of encrypted enemy messages concerning the date of the planned attack on your island. You immedietaly send for the Bytelandian C...

2018-08-28 10:24:41 259

原创 hdu 6278 Just h-index —— 主席树

Problem Description The h-index of an author is the largest h where he has at least h papers with citations not less than h.Bobo has published n papers with citations a1,a2,…,an respectively. One ...

2018-08-27 20:17:19 170

原创 SPOJ - MINSUB——单调栈+01矩阵变换

You are given an matrix M (consisting of nonnegative integers) and an integer K. For any submatrix of M’ of M define min(M’) to be the minimum value of all the entries of M’. Now your task is simple...

2018-08-26 21:57:48 261

原创 排列——逆康托展开

Description1,2,3,…n是自然数1到n的最小的排列,易知,第二小的排列是:1,2,3….n,n-1。现在给你2个值n和m,请找到1到n个数的第m小的排列。Input输入包括多组样例,对于每组样例包括两个整数n和m(1<=n<=1000,1<=m<=10000000),分别如题目所述Output输出第m小的排列的后各个数字,中间用空格分开,每...

2018-08-26 21:56:17 259

原创 HDU 4557 非诚勿扰 —— 优先队列+离散化+主席树

作为2013年699万应届毕业生中的一员,由于宏观经济的不景气,小明在毕业当天就华丽丽地失业了!   经历了千难万苦的求职过程,小明特别能理解毕业生的就业之难,所以,他现在准备创建一家专门针对IT人才的求职中介公司——非诚勿扰人力资源开发有限公司。   基于工作的需要,小明根据求职学生的简历描述为每人评定了一个综合能力值,能力值是一个小于等于20的正整数,值越高表示能力越强。当有公司试图招...

2018-08-26 16:30:20 220

原创 2018中国大学生程序设计竞赛 - 网络选拔赛 1010 YJJ's Salesman2018

Problem Description YJJ is a salesman who has traveled through western country. YJJ is always on journey. Either is he at the destination, or on the way to destination. One day, he is going to trave...

2018-08-25 18:52:00 877 3

原创 The Queue CodeForces - 767B ——贪心

Finally! Vasya have come of age and that means he can finally get a passport! To do it, he needs to visit the passport office, but it’s not that simple. There’s only one receptionist at the passport o...

2018-08-25 08:43:18 234

原创 Mike and distribution CodeForces - 798D ——二维贪心

Mike has always been thinking about the harshness of social inequality. He’s so obsessed with it that sometimes it even affects him while solving problems. At the moment, Mike has two sequences of pos...

2018-08-25 08:40:37 200

原创 hdu 4747 Mex —— 线段树+思维

Problem Description Mex is a function on a set of integers, which is universally used for impartial game theorem. For a non-negative integer set S, mex(S) is defined as the least non-negative integer...

2018-08-25 08:38:22 197

原创 POJ - 3481 Double Queue —— splay插入删除模板

DescriptionThe new founded Balkan Investment Group Bank (BIG-Bank) opened a new office in Bucharest, equipped with a modern computing environment provided by IBM Romania, and using modern informatio...

2018-08-25 08:38:00 175

原创 hdu 3487 Play with Chain —— splay区间翻转模板

Problem Description YaoYao is fond of playing his chains. He has a chain containing n diamonds on it. Diamonds are numbered from 1 to n. At first, the diamonds on the chain is a sequence: 1, 2, 3, …...

2018-08-25 08:37:51 138

原创 3223: Tyvj 1729 文艺平衡树 —— splay区间翻转模板题

Description 您需要写一种数据结构(可参考题目标题),来维护一个有序数列,其中需要提供以下操作:翻转一个区间,例如原有序序列是5 4 3 2 1,翻转区间是[2,4]的话,结果是5 2 3 4 1 Input 第一行为n,m n表示初始序列有n个数,这个序列依次是(1,2……n-1,n) m表示翻转操作次数 接下来m行每行两个数[l,r] 数据保证 1<=l<=r...

2018-08-25 08:37:42 202

原创 Cleaning Shifts POJ - 2376 ——贪心,最少线段覆盖

Farmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores around the barn. He always wants to have one cow working on cleaning things up and has divided the day i...

2018-08-25 08:37:32 223

原创 I - 后缀数组二·重复旋律2 HihoCoder - 1407

描述 小Hi平时的一大兴趣爱好就是演奏钢琴。我们知道一个音乐旋律被表示为长度为 N 的数构成的数列。小Hi在练习过很多曲子以后发现很多作品自身包含一样的旋律。旋律可以表示为一段连续的数列,相似的旋律在原数列不可重叠,比如在1 2 3 2 3 2 1 中 2 3 2 出现了一次,2 3 出现了两次,小Hi想知道一段旋律中出现次数至少为两次的旋律最长是多少?解题方法提示× 解题方法提示...

2018-08-25 08:37:17 150

原创 J - 后缀数组三·重复旋律3 HihoCoder - 1415

描述 小Hi平时的一大兴趣爱好就是演奏钢琴。我们知道一个音乐旋律被表示为长度为 N 的数构成的数列。小Hi在练习过很多曲子以后发现很多作品中的旋律有共同的部分。旋律是一段连续的数列,如果同一段旋律在作品A和作品B中同时出现过,这段旋律就是A和B共同的部分,比如在abab 在 bababab 和 cabacababc 中都出现过。小Hi想知道两部作品的共同旋律最长是多少?解题方法提示×...

2018-08-25 08:37:04 146

原创 单词接龙——欧拉路径

Description相信大家都玩过单词接龙。小明的爸爸设计了一个单词接龙密码,连续两个单词,前一个的尾字母和后一个的首字母必须相同(“acm”后面可以接如“motorola”)。若能把所有的单词都连起来,那么就可以解开密码,拿到零花钱。 现在有N天,就有N个密码。现在请你帮忙给出,小明有多少天可以拿到零花钱。Input第一行一个整数T(1<=T<=10)表示天数。 每...

2018-08-24 09:05:46 454

原创 HDU - 2476 ——区间dp

There are two strings A and B with equal length. Both strings are made up of lower case letters. Now you have a powerful string painter. With the help of the painter, you can change a segment of chara...

2018-08-24 09:03:02 174

原创 HDU - 2191——多重背包

急!灾区的食物依然短缺! 为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。 请问:你用有限的资金最多能采购多少公斤粮食呢? 后记: 人生是一个充满了变数的生命过程,天灾、人祸、病痛是我们生命历程中不可预知的威胁。 月有阴晴圆缺,人有旦夕祸福,未来对于我们而言是一...

2018-08-24 09:00:48 251

原创 HDU - 2159 FATE——二维费用背包问题

最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐度降到0或者0以下时,xhd就不会玩这游戏。xhd还说了他最多只杀s只怪。请问他能升掉这最后一级吗? Inp...

2018-08-24 08:58:55 124

原创 HDU - 2844——二进制优化多重背包

Whuacmers use coins.They have coins of value A1,A2,A3…An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided to buy a very nice watch in a nearby shop. He wanted ...

2018-08-24 08:56:55 237

原创 F - Choose the best route HDU - 2680 ——链式前向星+dijkstra

One day , Kiki wants to visit one of her friends. As she is liable to carsickness , she wants to arrive at her friend’s home as soon as possible . Now give you a map of the city’s traffic route, and t...

2018-08-24 08:53:55 185

原创 G - Bank Hacking CodeForces - 796C

Although Inzane successfully found his beloved bone, Zane, his owner, has yet to return. To search for Zane, he would need a lot of money, of which he sadly has none. To deal with the problem, he has ...

2018-08-24 08:49:37 229

原创 Problem J. CSGO —— 枚举

Problem Description You are playing CSGO. There are n Main Weapons and m Secondary Weapons in CSGO. You can only choose one Main Weapon and one Secondary Weapon. For each weapon, it has a composite ...

2018-08-24 08:49:07 339

原创 hdu 3727 Jewel —— 主席树+离散化+动态数组

Problem Description Jimmy wants to make a special necklace for his girlfriend. He bought many beads with various sizes, and no two beads are with the same size. Jimmy can’t remember all the details a...

2018-08-24 08:48:49 162

原创 hdu 4866 Shooting 主席树+离散化+一丢丢的思维

Problem Description In the shooting game, the player can choose to stand in the position of [1, X] to shoot, you can shoot all the nearest K targets. The value of K may be different on different shoo...

2018-08-24 08:48:10 222

原创 E - Conscription POJ - 3723——最大生成树

Windy has a country, and he wants to build an army to protect his country. He has picked up N girls and M boys and wants to collect them to be his soldiers. To collect a soldier without any privilege,...

2018-08-23 09:08:35 119

原创 HihoCoder - 1586 Minimum ——线段树

You are given a list of integers a0, a1, …, a2^k-1.You need to support two types of queries:Output Minx,y∈[l,r] {ax?ay}.Let ax=y.Input The first line is an integer T, indicating the number o...

2018-08-23 09:06:00 118

空空如也

空空如也

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

TA关注的人

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