自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 CodeForces 996B

Allen wants to enter a fan zone that occupies a round square and has n entrances. There already is a queue of ai people in front of the i-th entrance. Each entrance allows one person from its queue t...

2018-08-10 09:53:14 359

原创 string 函数

#include <string> #include <cstring> string s,c; s.substr(0,5);                           得到字符串s中从第0位开始的长度为5的字符串 s.size();                                   求字符串s的长度 reverse(s.begin()...

2018-08-09 21:33:03 334

转载 最小树形图——朱刘算法(转)

转自大佬:GGBeng 一、相关定义 定义:设G = (V,E)是一个有向图,它具有下述性质: G中不包含有向环;  存在一个顶点vi,它不是任何弧的终点,而V中的其它顶点都恰好是唯一的一条弧的终点,则称 G是以vi为根的树形图。 最小树形图就是有向图G = (V, E)中以vi为根的树形图中权值和最小的那一个。 另一种说法:最小树形图,就是给有向带权图一个特殊的点root,求一棵以ro...

2018-08-09 21:15:41 234

转载 高斯消元模板

#include<stdio.h> #include<algorithm> #include<iostream> #include<string.h> #include<math.h> using namespace std; const int MAXN=50; int a[MAXN][MAXN];//增广矩阵 int...

2018-08-09 21:07:54 151

原创 链式前向星(模板)

#include <algorithm> #include <iostream> #include <cstring> #include <cstdlib> #include <cstdio> #include <vector> #include <string> #include <cmath&a

2018-08-09 18:57:32 355

原创 Minimum Sum (划分树)

You are given N positive integers, denoted as x0, x1 ... xN-1. Then give you some intervals [l, r]. For each interval, you need to find a number x to make as small as possible! Input The first line...

2018-08-09 10:54:37 325

转载 划分树讲解(转)

       划分树,类似线段树,主要用于求解某个区间的第k 大元素(时间复杂度log(n)),快排本也可以快速找出,但快排会改变原序列,所以每求一次都得恢复序列。   下面就以 POJ 2104 进行解说:   题目意思就是,给你n 个数的原序列,有m 次询问,每次询问给出l、r、k,求原序列l 到r 之间第k 大的数。n范围10万,m范围5千,这道题用快排也可以过,快排过的时间复杂度n*m...

2018-08-08 11:34:19 257

转载 数位dp讲解(转)

数位DP其实是很灵活的,所以一定不要奢求一篇文章就会遍所有数位DP的题,这一篇只能是讲清楚一种情况,其他情况遇到再总结,在不断总结中慢慢体会这个思想,以后说不定就能达到一看到题目就能灵活运用的水平。(其实DP都是这样……) 这一篇要说的数位DP是一道最简单的数位DP:题目链接 题目大意:多组数据,每次给定区间[n,m],求在n到m中没有“62“或“4“的数的个数。       如62315包...

2018-08-08 08:22:12 226

原创 不要62 (数位dp)

杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。 杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。 不吉利的数字为所有含有4或62的号码。例如: 62315 73418 88914 都属于不吉利号码。但是,61152虽然含有6和2,但不是62连号,所以不属于不吉利数字之列。 你...

2018-08-07 20:28:11 221

原创 K-th Number (划分树)

  You are working for Macrohard company in data structures department. After failing your previous task about key insertion you were asked to write a new data structure that would be able to return q...

2018-08-07 16:37:52 290

原创 HDU-1556 Color the ball(线段树 树状数组)

N个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a <= b),lele便为骑上他的“小飞鸽"牌电动车从气球a开始到气球b依次给每个气球涂一次颜色。但是N次以后lele已经忘记了第I个气球已经涂过几次颜色了,你能帮他算出每个气球被涂过几次颜色吗? Input 每个测试实例第一行为一个整数N,(N <= 100000).接下来的N行,每行包括2个整数...

2018-08-01 13:04:52 172

原创 线段树模板

#include <algorithm> #include <iostream> #include <cstring> #include <cstdlib> #include <cstdio> #include <vector> #include <string> #include <cmath&a

2018-08-01 10:19:39 207

原创 HDU-1698 Just a Hook(线段树)

In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same length. Now Pudg...

2018-08-01 10:11:01 316

空空如也

空空如也

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

TA关注的人

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