自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(19)
  • 问答 (3)
  • 收藏
  • 关注

原创 codeforse1285D. Dr. Evil Underscores(01字典树)

D. Dr. Evil Underscores链接: https://codeforces.com/problemset/problem/1285/D.思路应该是挺简单的一个题,但是我考试的时候用的另一个小思路,哎,,做不出来就该换思路的。。正解应该就是按照01字典树插入,然后按照像线段树那样的遍历(如果一个节点有两个子节点,那么对于结果来说,这个节点代表的位置必然是1,就要加上,否者就可以不是1)。当时我觉得这样可能会TLE,因为如果遇到两个的就分开便利,那不就是要遍历2^30?后来想了想才知道,

2021-08-27 09:32:46 120

原创 CodeForces - 1547E(思维)

题目链接链接: https://codeforces.com/problemset/problem/1547/E.思路1(思维171ms)每一个点的温度,都有三种可能确定,1.本身的空调 2.从左边传过来 3.从右边传过来。所以从前向后过一遍最小值,再从后往前过一遍最小值就可以了思路1代码#include<iostream>#include<algorithm>#include<cstring>using namespace std;const int

2021-08-22 21:46:46 143

原创 CodeForces - 987E(逆序对定理+树状数组)

题目描述E. Petr and PermutationsPetr likes to come up with problems about randomly generated data. This time problem is about random permutation. He decided to generate a random permutation this way: he takes identity permutation of numbers from 1to n and t

2021-08-22 15:52:03 161

原创 LCIS HDU - 3308

题目描述LCIS HDU - 3308Given n integers.You have two operations:U A B: replace the Ath number by B. (index counting from 0)Q A B: output the length of the longest consecutive increasing subsequence (LCIS) in [a, b].InputT in the first line, indicating t

2021-08-21 22:41:44 194

原创 Minimum Inversion Number_HDU1394(树状数组)

题目Minimum Inversion NumberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 31439 Accepted Submission(s): 17797Problem DescriptionThe inversion number of a given number sequence a1, a2, …, an is

2021-08-20 18:04:57 46

原创 Infinite Inversions CodeForces - 540E(树状数组+离散化)

Infinite Inversions CodeForces - 540E题目There is an infinite sequence consisting of all positive integers in the increasing order: p = {1, 2, 3, …}. We performed n swap operations with this sequence. A swap(a, b) is an operation of swapping the elements of

2021-08-20 17:56:24 113

原创 HDU-4417:Super Mario(树状数组+离线操作)

题目描述HDU-4417:Super Mario(树状数组+离线操作)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. We regard the road to the boss’s castle

2021-08-17 10:18:55 166

原创 A Simple Problem with Integers(线段树)

A Simple Problem with Integers 题目You 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 in a given interval. The other is to ask for the sum of numbers in a give

2021-08-16 15:26:12 64

原创 HDU1385—— Minimum Transport Cost

HDU1385—— Minimum Transport Cost题目描述An integer interval [a,b], a < b, is a set of all consecutive integers beginning with a and ending with b.Write a program that: finds the minimal number of elements in a set containing at least two different intege

2021-08-04 18:28:43 87

原创 HDU1811Rank of Tetris

题目HDU1811Rank of Tetris自从Lele开发了Rating系统,他的Tetris事业更是如虎添翼,不久他遍把这个游戏推向了全球。为了更好的符合那些爱好者的喜好,Lele又想了一个新点子:他将制作一个全球Tetris高手排行榜,定时更新,名堂要比福布斯富豪榜还响。关于如何排名,这个不用说都知道是根据Rating从高到低来排,如果两个人具有相同的Rating,那就按这几个人的RP从高到低来排。终于,Lele要开始行动了,对N个人进行排名。为了方便起见,每个人都已经被编号,分别从0到N-

2021-08-04 00:09:59 75

原创 Are you an expert on priority queue?(优先队列)

题目 Because of the wrong status of the bicycle, Sempr begin to walk east to west every morning and walk back every evening. Walking may cause a little tired, so Sempr always play some games this time.There are many stones on the road, when he meet a stone

2021-08-03 15:24:16 49

原创 hdu4857 逃生(不是小根堆)

题目描述 糟糕的事情发生啦,现在大家都忙着逃命。但是逃命的通道很窄,大家只能排成一行。现在有n个人,从1标号到n。同时有一些奇怪的约束条件,每个都形如:a必须在b之前。同时,社会是不平等的,这些人有的穷有的富。1号最富,2号第二富,以此类推。有钱人就贿赂负责人,所以他们有一些好处。负责人现在可以安排大家排队的顺序,由于收了好处,所以他要让1号尽量靠前,如果此时还有多种情况,就再让2号尽量靠前,如果还有多种情况,就让3号尽量靠前,以此类推。那么你就要安排大家的顺序。我们保证一定有解。 In

2021-08-03 14:49:43 63

原创 POJ_1849 Two

题目描述POJ_1849 TwoDescriptionThe city consists of intersections and streets that connect them.Heavy snow covered the city so the mayor Milan gave to the winter-service a list of streets that have to be cleaned of snow. These streets are chosen such that

2021-07-31 21:27:53 83

原创 CodeForses_871D Imbalanced Array

题目描述CodeForses871D. Imbalanced Arraytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array a consisting of n elements. The imbalance value of some subsegment of this array is t

2021-07-31 20:44:53 121

原创 CodeForces - 631B——Print Check

题目CodeForces - 631B——Print CheckKris works in a large company “Blake Technologies”. As a best engineer of the company he was assigned a task to develop a printer that will be able to print horizontal and vertical strips. First prototype is already built

2021-07-28 13:05:27 114

原创 CodeForse631C_Report(单调栈)

题目Each month Blake gets the report containing main economic indicators of the company “Blake Technologies”. There are n n n commodities produced by the company. For each of them there is exactly one integer in the final report, that denotes corresponding

2021-07-27 22:07:25 107

原创 A problem of sorting

题目描述There are many people’s name and birth in a list.Your task is to print the name from young to old.(There is no pair of two has the same age.)InputFirst line contains a single integer T≤100 which denotes the number of test cases.For each test case,

2021-07-20 15:39:11 79

原创 Tallest Cow

题目描述Kevin的军训时间一年一度的军训又开始啦,Kevin作为大二学长也想掺和一脚,他看到计算机类2001班总共有N(1 ≤ N ≤ 10,000)个小萌新,他们按照1-n编号并站成一排。每个萌新都有一个正整数的身高,Kevin目测得到最高的萌新的身高H (1 ≤ H ≤ 1,000,000)和他所在位置编号I。(注意可能最高的萌新不止一个,I只是其中之一)教官给了Kevin一个拥有R (0 ≤ R ≤ 10,000)行的列表,每行给出A,B,这表示A、B两个位置的萌新能够互相看到。(B位置萌新的

2021-07-17 10:14:28 100

原创 PAT乙级题1010 一元多项式求导 (25分)几个坑点(主要是第三个测试点)

本人新人,这些代码都慢慢摸索出来的,在博客上没看到正解,也可能是我没找到,就是第三个测试点的新手版=-=;;代码如下#include<stdio.h>int main(){ int k,n; int i=0; while(scanf("%d%d",&k,&n)!=EOF){ if(n==0&&k==0){ if(i!=0) prin...

2019-12-12 22:21:22 1251 4

空空如也

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

TA关注的人

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