自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

I am growing~.

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

原创 日记—8.31

刚开学,有了新的课程,发现大二的前几个周的课程确实有点满啊,有没有,,,确实没有假期大块的时间来做看知识点和练习了。这几天课后大体的看了看线段树的知识点和课件上的例题,但是还没有简单的实现一下代码。。。。。。今天下午满课没有做那套邀请赛的题,但是今晚上看了看几个题,写了写第一个题,第一个题让求不大于一个数n的k^k,满足这个条件的k有几个,n的范围是1e18,这个范围一看太大,硬做的话肯定出错,所

2017-08-31 21:54:17 267

原创 暑假训练总结

回过头,看看这个暑假,真是快啊,尤其在家休息半个月回校的在机房这将近一个月,时间过的格外的快。      其实在家半个月要复习一下dp专题,基本上没做。给人家打了一个周的工,然后剩下的那个周在家做了两道题,而且都是原题,在家实在太懒散了,静不下心去看看书,然而,在学校的这几天的日子过的很充实。      回过头看看这个暑假啊,上来做的搜索,接着做的图论,二分,单调队列,还有这两天做

2017-08-25 22:41:53 471

原创 训练日记8.23

今天做了一个二维树状数组的题,也是练习的实现一下,二维树状数组数组和一维树状数组数组基本没有差的,先是写了个二维树状数组实现了一下,然后做了做坐这个题,中间真是出了不少的问题,这两天做的题比较少,但是对树状数组的渐渐有了一些新的认识,这两天趁热也要抓紧的做练习了。

2017-08-23 22:45:28 305

原创 二维树状数组(4种操作)

Problem DescriptionNow I am leaving hust acm. In the past two and half years, I learned so many knowledge about Algorithm and Programming, and I met so many good friends. I want to say sorry to Mr,

2017-08-23 22:30:21 282

原创 树状数组关于区间修改区间求和的问题

Total Submission(s) : 77   Accepted Submission(s) : 19Problem DescriptionYou have N integers, A1,A2, ... , AN. You need to deal with two kinds of operations. One type of operation is to add so

2017-08-23 22:22:11 345

原创 树状数组—求逆序数的个数

Problem DescriptionIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until t

2017-08-23 22:18:28 397

原创 训练日记8.22

今天下午的练习,做的第二个题,有点坑队友了。题意啊,到最后还是顺着错误的题意做的,他是要求的到达一个点是一个最短路径,回到原点的时候不能走原来的那一条路,但还是最短路径,用弗洛伊德,TLE,和WA之后依旧没有发现题意理解的错了。。。然后让小伙伴看了看这个题,确实,给人家带跑了。第二个题按照正确的题意,确实弗洛伊德能做出来,但是算法里的三重循环会超时啊,所以要用更好的优化的算法SPFA。晚上继续看了

2017-08-22 22:57:06 224

原创 树状数组的三种模式

我们在这之前已经了解过了lowbit的概念,还有对于树状数组的基本的认识了,然后,再学习树状数组的基础用法。树状数组主要有三种类型,从简单到复杂。 依次是修改点,求区间和 ,修改区间求点,还有最复杂的修改区间,求区间。最简单的第一种模型:int lowbit(int x){ return (x&(-x));}void add(int x,int v)

2017-08-22 21:51:35 261

原创 训练日记8.21

今天上午做了一道blog上的一个原题,用两种差不多的方法交了两边,对于求有多少的逆序数,或者某一个数的左边有多少数比这个数大,这类的题理解的更深了。昨天看了一篇别人的blog,对于树状数组的第二种模式,第三种模式的理解更深了。然后自己写了一个模式三的,但是在,区间更新点的时候,有点混淆,而且在求的时候直接列了一个大的式子,而不是像课件上的,用多个函数给他分步骤求,所以回头又看了看课件,果然理解起来

2017-08-21 22:39:26 248

原创 训练日记8.19

最近学的树状数组,感觉这方面的题得多看,多了解,才能在做题的时候很好的用它。下午的ccpc网络赛,怎么说,刚上来做一道字符串的题,给你两个字符串s1,s2,例如s2=aba,依次截取s2的是 {aba}{ba}{a},我们n代表截取的片段的长度;之后看看片段在字符串s1中的个数,用l代表,举个例子吧,截取的片段{aba} 在s1={abababab}中的个数由3个,所以l=3。 把每一次在s2

2017-08-19 23:02:46 312

原创 训练日记8.18

树状数组,看了看饶齐的blog,发现总结的知识点和写的东西相当好啊。关于树状数组,最基础的用法就是用来求第 i 的数字的前面有多少个比它大或者小的数。例如我们在这里求第i个数前面有几个比它小的数吧,在这里设置一个数组 C[]吧,先从a[i]向左扫描,让C[k]=1,表示大小位K 的值已经被扫描到了,所以他左边比它小的个数就C[1]+C[2]++++++C[a[i]-1],也就是是sum[a

2017-08-18 22:21:39 279

原创 入门树状数组(左边比x小的个数)

我们在这里求第i个数左边有几个比它小的数,还有右边有几个比它小的数。那左边的这一种情况来说吧,在这里设置一个数组 C[]吧,先从a[i]向左扫描,让C[k]=1,表示大小位K 的值已经被扫描到了,所以他左边比它小的个数就C[1]+C[2]++++++C[a[i]-1],也就是是sum[a[i]]。然后向上更新点C[a[i]]++。//左边比他小的数的 个数 //试下1 2 3

2017-08-18 22:12:39 1223

原创 训练日记8.17

上午看的树状数组,那个三个模型的最后一种模型真的不好理解,改区间求区间的模型,来来回回看了好几遍,还是晕额。 下午做的那套题,第一个题我做的,刚开始按我的理解做的一直WA ,然后又和小伙伴读了两遍题,之后小伙伴也是改了一通,也没有。这个题考的思维,,再加上对题意把握的不是很准,这个题到最后弃了。今天下午唯一出来的就是最后一个水题,说出来有点丢人啊 。。之后小伙伴做着d题,我看了看e题,结果谁都没有

2017-08-17 22:44:27 245

转载 关于lowbit

lowbit(i)的意思是将i转化成二进制数之后,只保留最低位的1及其后面的0,截断前面的内容,然后再转成10进制数。即lowbit(i) = i&(-i)。参数x为有符号整型数,-x通过求补码获得比如,x=6,及二进制数0110,那么按照补码求法,-x的值为1001+1=1010接着,x&-x,结果等于0010,作为函数的返回值可见该函数的作用是:返回x的最后一个为“1”的bit位的位置。将 x

2017-08-16 23:00:19 721

原创 训练日记8.16

今天上午看了一道感觉很新颖的题,给你一个矩阵,只有 数字0,1,求一个最大的子矩阵,(矩阵是由1组成的),是Largest Rectangle in a Histogram的一个变型的题,其实每一行都可以转化成一个树状图形,求最大矩阵题的样子,还记得刚开始看到这个题的时候,怎么也没有想到是一个单调队列的题,表示自己的思维很伤。下午看了看树状数组。今天老师提到换学习方式,确实,没有很好理解总结一个算

2017-08-16 22:54:42 205

原创 训练日记8.15

今天下午做的题,很伤啊。。第一个题,稍变形的bfs,真的不是很难,很快写出来了,用一个结构体,放坐标x,y,step,还有重要的一个变量叫它thing吧,如果thing为0,那就表明没有带上4这个物品,相反就是带上了4这个物品。最后的限制条件是到达了终点并且还带这个物品,这个方法很快写好了,但是。。。。。。一直没有出来结果。为什么呢?做完题走的时候听说小伙伴第一个题使用好几次搜索,从头到搜索到

2017-08-15 22:42:15 365

原创 Knights of Ni (bfs)

DescriptionBessie is in Camelot and has encountered a sticky situation: she needs to pass through the forest that is guarded by the Knights of Ni. In order to pass through safely, the Knights have d

2017-08-15 22:18:36 413

原创 训练日记8.14

今天做了几个队列的,真的爽额,花了差不多一上午的时间看例题,弄什么是单调队列,这个问题真的很严重。做了一个移动窗户问题之后,看了一个给你一个树状图,求最大矩形面积的问题,直接做的话O(n2) ,而队列能的时间的复杂度降到O(n),初次接触这种方法,感觉这个方法很溜,当然让人也是很炸,光是求最大的矩形面积的这个题,就看了好长时间的别人写的blog,从头开始在本子上推。作为一个小白,还有更多的溜的

2017-08-14 21:50:31 201

原创 Feel Good

Problem DescriptionBill is developing a new mathematical theory for human emotions. His recent investigations are dedicated to studying how good or bad days influent people's memories about some p

2017-08-14 21:23:25 285

原创 Largest Rectangle in a Histogram

Problem DescriptionA histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heights. For example, the fi

2017-08-14 21:17:16 227

原创 Sliding Window

Problem DescriptionAn array of size n ≤ 106 is given to you. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the knumbers in

2017-08-14 21:08:19 253

原创 Drying

Problem DescriptionIt is very hard to wash and especially to dry clothes in winter. But Jane is a very smart girl. She is not afraid of this boring process. Jane has decided to use a radiator to

2017-08-13 16:37:32 352

原创 Prime Gap

DescriptionThe sequence of n − 1 consecutive composite numbers (positive integers that are not prime and not equal to 1) lying between two successive prime numbersp and p + n is called a prime

2017-08-13 16:29:33 553

原创 xpanding Rods

DescriptionWhen a thin rod of length L is heated n degrees, it expands to a new length L' = (1+n*C)*L, where C is the coefficient of heat expansion.When a thin rod is mounted on two solid wall

2017-08-13 16:23:50 288

原创 训练日记8.12

今天做了三道题,做题给我的感觉就是,WA,TLE,OLE,尤其是今天上午的一道题,很简单的二分,杠了一上午,搜了题解,还有小伙伴做的发现,二分的东西不一样,他们都是直接二分的结果的那个变量,我用自己的方法 二分了另一个变量,结果出了许多的问题,样例同通过但是WA ,虽然精度要到1e-8才可以,人家的1e-6就行。还有今晚这道题,TLE,用scanf 和printf了然后虽然不是TLE了但又是OLE

2017-08-12 22:54:29 210

原创 训练日记8.11

今天主要做的就是二分关于,最大化最小值问题,快看拉一上午的课件,感觉很别扭,不好理解,然后看一些别人关于最大化最小值问题的blog, 感觉点击打开链接  这个题的解释比较好 。开始做了一个Aggressive cows,下午做了一个Monthly Expense,然后做了一个差不多的 Copying Books 。关于最大化最小值问题就做了这么几个题。这些题差不多都是照着模板差不多

2017-08-11 22:49:38 218

原创 Copying Books(最大化最小值问题)

点击打开链接Problem DescriptionBefore the invention of book-printing, it was very hard to make a copy of a book. All the contents had to be re-written by hand by so called scribers. The scriber had be

2017-08-11 20:45:12 677 2

原创 Monthly Expense(最大化最小值问题)

点击打开链接Problem DescriptionFarmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of mon

2017-08-11 20:18:56 1166

原创 Aggressive cows(最大化最小值问题)

点击打开链接Problem DescriptionFarmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,...,xN (0 <= xi <= 1,000,000,000).

2017-08-11 20:09:37 714

原创 Max Factor(找最大素数)

To improve the organization of his farm, Farmer John labels each of his N (1 <= N <= 5,000) cows with a distinct serial number in the range 1..20,000. Unfortunately, he is unaware that the cows interp

2017-08-10 23:39:32 875

原创 训练总结8.10

今天做了做二分三分的,简单回忆了知识点,有的题是原先做过的,总之是比较简单经典的。一些题Strange fuction 三分Can you solve this equation?Pie今天下午的题做了四道,做出来比较容易,但是太容易WA了,找错,刚刚还在找一个题的错.......求星期几的问题一个数塔问题Satellite Photographs(

2017-08-10 23:12:37 212

原创 Satellite Photographs(dfs)

Farmer John purchased satellite photos of W x H pixels of his farm (1 <= W <= 80, 1 <= H <= 1000) and wishes to determine the largest 'contiguous' (connected) pasture. Pastures are contiguous when any

2017-08-10 22:39:30 658

原创 一个数塔问题

The cows don't use actual bowling balls when they go bowling. They each take a number (in the range 0..99), though, and line up in a standard bowling-pin-like triangle like this: 7

2017-08-10 22:35:07 450

原创 求星期几的问题

Bessie asked her friend what day of the week she was born on. She knew that she was born on 2003 May 25, but didn't know what day it was. Write a program to help. Note that no cow was born earlier tha

2017-08-10 22:33:05 903

原创 Pie

点击打开链接Problem DescriptionMy birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are co

2017-08-10 22:24:55 370

原创 Can you solve this equation?

点击打开链接Problem DescriptionNow,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100;Now please try your lucky. InputThe first line of the inp

2017-08-10 22:17:15 248

原创 Strange fuction 三分

点击打开链接Problem DescriptionNow, here is a fuction:  F(x) = 6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 Can you find the minimum value when x is between 0 and 100. InputThe first line of the input c

2017-08-10 22:12:38 339

原创 8.9训练总结

今天做了一个深搜的Shredding Company,和两个图论题,其中一个是判断是不是负权回路,这种的题,书上已经告诉如何判断了,知道了方法还是很简单的,Wormholes还有一道,最小生成树问题,Truck History 搜索 图论的专题也要结束了,给我感觉就是做的不熟练,熟练度没有。嗯,这些东西要多多的写几遍才行。这个专题,还需要好好的练习巩固,最主要的是要多写几遍

2017-08-09 21:46:04 204

原创 Truck History(最小生成树)

Problem DescriptionAdvanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are used for vegetable delivery, other for furniture, or for bricks. The company has its own code describ

2017-08-09 21:03:00 344

原创 Wormholes(负权回路)

点击打开链接Problem DescriptionWhile 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 that delivers you to i

2017-08-09 20:53:55 624

空空如也

空空如也

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

TA关注的人

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