自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

永远鲜红の幼月的博客

累了,毁灭吧,躺平了

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

原创 poj-2299-Ultra-QuickSort(树状数组,离散化+逆序数)

题目链接:http://poj.org/problem?id=2299DescriptionIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacen...

2018-07-27 18:33:07 237

原创 zoj-1221-Risk(最短路)

题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1221Risk is a board game in which several opposing players attempt to conquer the world. The gameboard consists of a world map broke...

2018-07-27 17:46:11 360

原创 关于结构体重载,初始化,优先队列的排序(杂谈)

直接给个样例:struct node{ int x,y; node(int x1,int y1):x(x1),y(y1){} friend node operator +(node a,node b){ return node(a.x+b.x, a.y+b.y); } bool operator <(const node x1)const{ return x1.y&g...

2018-07-27 16:56:35 947

原创 poj-2481-Cows(排序树状数组+逆序数)

题目链接:http://poj.org/problem?id=2481DescriptionFarmer John's cows have discovered that the clover growing along the ridge of the hill (which we can think of as a one-dimensional number line) in his...

2018-07-27 11:22:22 190

原创 HDU-1698-Just a Hook(线段树,区间修改,区间查询)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1698 Problem Description 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 o...

2018-07-26 11:54:15 227

原创 HDU-1369-Minimum Inversion Number(树状数组|线段树,求逆序数)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1394 Problem Description The inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i < j a...

2018-07-26 11:50:31 160

原创 HDU-1754-I Hate It(线段树最大值模板)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1754 Problem Description 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩...

2018-07-26 09:51:28 169

原创 poj-3067-Japan(树状数组,逆序数)

题目链接:http://poj.org/problem?id=3067DescriptionJapan plans to welcome the ACM ICPC World Finals and a lot of roads must be built for the venue. Japan is tall island with N cities on the East coast ...

2018-07-25 20:09:00 165

原创 hdu-2838-Cow Sorting(树状数组求逆序数)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2838 Problem Description Sherlock's N (1 ≤ N ≤ 100,000) cows are lined up to be milked in the evening. Each cow has a unique "grumpiness" level ...

2018-07-25 18:49:31 211

原创 poj-3468-A Simple Problem with Integers(树状数组||线段树,区间刷新,区间求和)

题目链接:http://poj.org/problem?id=3468DescriptionYou have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number...

2018-07-25 09:19:01 299

原创 poj 2352 star(树状数组)

题目链接:http://poj.org/problem?id=2352DescriptionAstronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star ...

2018-07-25 09:13:18 105

原创 codevs-1082 线段树练习(其实我用的是树状数组)(区间修改,区间查询)

题目链接:http://codevs.cn/problem/1082/题目描述 Description给你N个数,有两种操作:1:给区间[a,b]的所有数增加X2:询问区间[a,b]的数的和。输入描述 Input Description第一行一个正整数n,接下来n行n个整数, 再接下来一个正整数Q,每行表示操作的个数, 如果第一个数是1,后接3个正整数,...

2018-07-24 09:27:21 174

原创 HDU-1556(树状数组-区间更新 单点查询)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1556 Problem Description N个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a <= b),lele便为骑上他的“小飞鸽"牌电动车从气球a开始到气球b依次给每个气球涂一次颜色。但是N次以后lele已经忘记了第I个气球已经涂过几...

2018-07-23 16:47:53 221

原创 HDU-1166-排兵布阵(树状数组简单模板,Update了一个线段树的)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1166 Problem Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵...

2018-07-23 14:52:35 191

原创 Codeforces Round #498 (Div. 3),A,B,C

                           A. Adjacent Replacements题目链接:http://codeforces.com/contest/1006/problem/AMishka got an integer array aa of length nn as a birthday present (what a surprise!).Mishka do...

2018-07-21 11:34:38 241

原创 poj炸

今天poj炸了,写不了题了,纪念一下2018/7/20(窃笑)poj又炸了,yi'j已经持续1天了。。2018/7/24,几道题等着提交呢。。。为什么poj又炸了??以前怎么没发现poj这么容易炸。。。2018/7/27.。。刷新一下POJ炸了 2018/12/7 18:54POJ 2019/2/6 20:37的时候发现POJ炸了,看了看记录,最后一发是2/4号...

2018-07-20 17:08:49 395 4

原创 链式向前星数组模拟邻接表

#include<stdio.h>#include<string.h> #include<math.h> //#include<map> //#include<set>#include<deque> #include<queue> #include<stack&amp

2018-07-20 16:57:42 321

原创 Aizu2249(spfa || djstr+堆优化)两个参数的最短路

题目链接:http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2249 Road ConstructionKing Mercer is the king of ACM kingdom. There are one capital and some cities in his kingdom. Amazingly, there a...

2018-07-20 16:24:04 488

原创 poj-3268(最短路,逆转矩阵||spfa优先队列优化)

题目链接:http://poj.org/problem?id=3268DescriptionOne cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total...

2018-07-19 01:05:34 233

原创 spfa 判断负环poj3259

题目链接:http://poj.org/problem?id=3259DescriptionWhile exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path tha...

2018-07-18 21:39:19 147

原创 poj-3616milking time(dp)

题目链接:http://poj.org/problem?id=3616DescriptionBessie is such a hard-working cow. In fact, she is so focused on maximizing her productivity that she decides to schedule her next N (1 ≤ N ≤ 1,000,00...

2018-07-17 11:48:33 120

原创 poj-2385Apple Catching(dp)

题目链接:http://poj.org/problem?id=2385DescriptionIt is a little known fact that cows love apples. Farmer John has two apple trees (which are conveniently numbered 1 and 2) in his field, each full of ...

2018-07-17 10:04:53 212 1

原创 poj-2229-Sumsets(递推式)

题目链接:http://poj.org/problem?id=2229DescriptionFarmer John commanded his cows to search for different sets of numbers that sum to a given number. The cows use only numbers that are an integer power...

2018-07-17 09:08:08 115

原创 POJ-1088-滑雪(dfs+记忆搜索)

题目链接:http://poj.org/problem?id=1088 DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子  1 2 3 ...

2018-07-11 20:47:51 186

原创 C++,对文件的操作

据说直接提交文件内容会让代码跑的更快??(都市传说)对文件进行操作,包括查找,储存,遍历,输出;以本地的一个记事本当一个字典来进行实验Update-2019-8-22--文件读入数据。freopen(".in","r",stdin);freopen(".out","w",stdout);用到头文件:#include<fstream>用到的函数:记住要在打...

2018-07-10 23:05:12 159

原创 基于转角数为基准的广度优先搜索(样例:连连看)

c++作业,设计一个简单的连连看程序,建立一个 图 ,然后每次输入两个坐标,判断是否可以消除,初次写觉得广搜可以完成(事实证明的确可以),但是略有些麻烦,本来想看老师的代码的,结果一下整个600来行的简单模拟(八种情况,分别尝试),太麻烦了,就查找这方面的资料,《编程之美》中就对这个方面有所涉及:下面;首先找到一个起点,起点到终点的路径问题,中间转角数小于3,记录转角;代码如下,亲自测试消...

2018-07-09 11:09:28 397

原创 C++--使用随机数

随机数的使用非常普遍,现在总结一下随机数的生成的方法;C:rand()产生随机数:使用库:stdlib.h+time.h较长使用的是rand(void)函数,它是根据一个随机数种子在一个算法下,产生一个小范围内可看成随机数的一个函数,因为随机数种子在不改变的时候每次调用rand()都是相同的结果,因此,在少量的数据时,我们完全可以使用rand()函数产生随机数,对rand()函数取...

2018-07-09 10:13:28 298

空空如也

空空如也

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

TA关注的人

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