自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(44)
  • 资源 (1)
  • 收藏
  • 关注

原创 训练日记

今天上午接着看的平衡树,模板基本上都看懂了。就是数据结构时候学的平衡二叉树,学起来还是很快的。下午就做了两个题,一个是思维题,主要是要懂相等的两个数的异或为0,巧妙的利用就好了。还有一个用multiset就可以直接插入删除直接水过的。还看了一个欧拉回路题,巧妙的爆搜就可以,就是在爆搜的时候删边就可以。明天继续...

2018-07-31 21:57:09 79

原创 treap

模板:#include <stdio.h>#include <stdlib.h>#include <iostream>using namespace std;typedef struct TreapNode* Tree;typedef int ElementType;struct TreapNode{ ElementType val;...

2018-07-31 18:50:01 115

原创 训练日记

今天的多校比赛卡了,第一题思路是对的,但是单调队列搞错了方向,从前往后,感觉细节很多,根本没有办法确定起点。但是从后往前很容易确定终点(即从前往后的起点)。搞了三个小时的一直wrong,最后找到了bug,但是实在是改不动了。感觉这个题很可惜。以后做这种单调队列的题一定注意技巧。比如从前往后,从后往前。。优先队列要注意排序方法.还有我今天还做了一个暴力水题也是异或问题。上午还是看的平衡树。。把那...

2018-07-30 21:21:29 119

原创 Problem A. Ascending Rating

Problem Description Before the start of contest, there are n ICPC contestants waiting in a long queue. They are labeled by 1 to n from left to right. It can be easily found that the i -th cont...

2018-07-30 21:14:13 620

原创 训练日记

今天把昨天的题补了就是最后一个,用了一个很巧的方法。这是一个感觉对了就能出,感觉不对就不能出的题。。然而我想的是笨方法的拓扑排序,过不了,如果加线段树优化就可以,但是我不会。或者想巧的方法。。。没想法。那个规律题我今天自己推了一遍很简单。。今天还看了平衡树。。明天继续...

2018-07-29 22:03:02 70

原创 Dynamic Rankings

题意:给n个数,有m个操作。修改某个数,或者询问一段区间的第k小值。 代码:#include<cstdio>#include<cstring>#include<iostream>#include<algorithm>#define LL long longusing namespace std;const int maxn=...

2018-07-29 20:50:13 327

原创 Hash Function

链接:https://www.nowcoder.com/acm/contest/142/J Chiaki has just learned hash in today's lesson. A hash function is any function that can be used to map data of arbitrary size to data of fixed size. A...

2018-07-29 20:27:30 773

原创 Maximum Mode

链接:https://www.nowcoder.com/acm/contest/142/G题目描述The mode of an integer sequence is the value that appears most often. Chiaki has n integers a1,a2,...,an. She woud like to delete exactly m of them ...

2018-07-29 10:03:37 185

原创 训练日记

今天打的比赛整体很不好,我一开始做的就是最后一个题,做了两个小时,我看到那一个题,就感觉是拓扑排序,但是还是要用线段树来优化边,否则一直会tle,我一直找不到方法,我做了好久没有出来就放弃了,因为当时我们队一个题也没有出,划水都没有成功。就是 一个简单的暴力题,刘文亚想复杂了,一直wrong。。最后换了一个方法过了。。。然而G题,我没有考虑全就wrong了,周金秀就TLE。。。那个规律题找出来也没...

2018-07-28 21:57:04 193

原创 训练日记

今天看了发的主席树。。典型的题目就是求某个区间的第k小建树的时候如果修改当前节点则直接新建,否则则将原来这一点指向现在的这一点,不需要进行修改,这是主席树的关键。维护的区间相同,结构相同,保存的信息不同,因此具有了加减性。所以在求区间的时候,若要处区间[l, r], 只需要处理rt[r] - rt[l-1]就可以了,(rt[l-1]处理的是[1,l-1]的数,rt[r]处理的是[1,r]的数,...

2018-07-27 22:08:31 83

原创 Kth number

http://acm.hdu.edu.cn/showproblem.php?pid=2665题意:查找某个区间第k小的数是什么分析:主席树模板代码:#include <cstdio>#include <cstring>#include <algorithm>using namespace std;const int N = 10...

2018-07-27 22:02:08 298

原创 Diff-prime Pairs

链接:https://www.nowcoder.com/acm/contest/141/H题目描述Eddy has solved lots of problem involving calculating the number of coprime pairs within some range. This problem can be solved with inclusion-excl...

2018-07-27 10:23:09 228

原创 Sort String

链接:https://www.nowcoder.com/acm/contest/141/E题目描述Eddy likes to play with string which is a sequence of characters. One day, Eddy has played with a string S for a long time and wonders how could ma...

2018-07-27 09:22:49 512

原创 训练日记

今天的背包题,很水,但是我以为用背包会超时6*10^7,然后就没有写,一直空着,最后他们说让暴力深搜不会超时,我就试了试剪枝优化,最后今晚讲题的时候说可以背包,刘文亚就说“我说不会超时吧”。果然又浪费了一批时间。素数的题也是可以的,筛素数再加一个for循环就OK了。还有一个kmp的,判断n是否是循环节的整数倍就行。今天比赛的时候我以为我们又要凉了,以为只能出来一个题,幸好又出了几个题。。。心慌慌...

2018-07-26 22:09:13 69

原创 PACM Team

链接:https://www.nowcoder.com/acm/contest/141/A来源:牛客网 题目描述Eddy was a contestant participating in ACM ICPC contests. ACM is short for Algorithm, Coding, Math. Since in the ACM contest, the most imp...

2018-07-26 21:56:24 313

原创 训练日记

今天水了一波。。。就做了两个签到题。。。没啥好说的https://blog.csdn.net/lml11111/article/details/81210663线段树的题没有出来,因为一开始的思路就不对,现在知道了要维护区间的最小值,如果最小值为0,则更新这个点+1,然后把这个点变成b[i]。。。就能求出结果了。。。时间是(n*logn)明天补 ...

2018-07-25 21:38:53 82

原创 Swaps and Inversions

Problem DescriptionLong long ago, there was an integer sequence a.Tonyfang think this sequence is messy, so he will count the number of inversions in this sequence. Because he is angry, you will ha...

2018-07-25 21:31:11 119

原创 训练日记

不得不说一下昨天的括号匹配的题。。。。我用优先队列排序的时候我想优先处理最小值较大的两个,因为我觉得把最小值的最小放后面,最后不能用的结果一定是最小的,我的想法是没有错误的。。。然后我重载小于号的时候符号写反了!!!!符号写反了!!!!符号写反了!!!!重要的事情说三遍。。。我没有看出来,然后我就把排序方法乱七八糟的改了。。。最后我又把代码改回去,符号也改反了。。。当时还没有意识到我第一次是写错了...

2018-07-24 21:52:16 99

原创 Balanced Sequence

http://acm.hdu.edu.cn/showproblem.php?pid=6299 Problem Description Chiaki has n strings s1,s2,…,sn consisting of '(' and ')'. A string of this type is said to be balanced: + if it is the e...

2018-07-24 21:34:09 223

原创 训练日记

今天打比赛的时候我先做的最后一个题,细节超级多,浪费了我好长时间,整体的思路很简单,只进行减法就行。。。https://blog.csdn.net/lml11111/article/details/81174714接着我又做了一个贪心的题,一开始就打算通过排序然后记录实现贪心,发现后来细节问题太多,然后我就想又优先队列实现存储和弹出,越想越觉得这个想法是对的,然后1Ahttps://blo...

2018-07-23 21:23:29 67

原创 Distinct Values

Problem DescriptionChiaki has an array of n positive integers. You are told some facts about the array: for every two elements ai and aj in the subarray al..r (l≤i<j≤r ), ai≠aj holds.Chiaki woul...

2018-07-23 21:14:16 580

原创 Time Zone

Problem DescriptionChiaki often participates in international competitive programming contests. The time zone becomes a big problem.Given a time in Beijing time (UTC +8), Chiaki would like to know ...

2018-07-23 21:09:08 262

原创 训练日记

今天把昨天剩下的题补了两个,一个是移动东西的题,二分+贪心,感觉要是比赛的时候认真想想应该能出的,现在想想之前做了很多这种题型,但是还是没有想出来。。https://blog.csdn.net/lml11111/article/details/81159283施肥的题,有想过树状数组,但是不知道怎么操作使之验证该点有没有破坏,想不出来,看题解的时候看了一个二维的树状数组先更新某一值判断等于...

2018-07-22 22:20:03 93

原创 farm

链接:https://www.nowcoder.com/acm/contest/140/J来源:牛客网 题目描述White Rabbit has a rectangular farmland of n*m. In each of the grid there is a kind of plant. The plant in the j-th column of the i-th row...

2018-07-22 21:53:34 329

原创 transform

链接:https://www.nowcoder.com/acm/contest/140/G 题目描述White Cloud placed n containers in sequence on a axes. The i-th container is located at x[i] and there are a[i] number of products in it.White R...

2018-07-22 21:43:26 175

原创 训练日记

今天又做了三个签到题,第一个签到题wrong了四次,因为看错了Q和K的位置,输入给弄错了。https://blog.csdn.net/lml11111/article/details/81148868第二个就是贪心,做过一个类似的题,1A。https://blog.csdn.net/lml11111/article/details/81149230还有一个找规律的,我直接开了两个数...

2018-07-21 22:03:40 78

原创 car

链接:https://www.nowcoder.com/acm/contest/140/I题目描述White Cloud has a square of n*n from (1,1) to (n,n).White Rabbit wants to put in several cars. Each car will start moving at the same time and mov...

2018-07-21 21:57:41 203

原创 money

链接:https://www.nowcoder.com/acm/contest/140/D 题目描述White Cloud has built n stores numbered from 1 to n.White Rabbit wants to visit these stores in the order from 1 to n.The store numbered i has ...

2018-07-21 21:52:50 107

原创 run

链接:https://www.nowcoder.com/acm/contest/140/A 题目描述White Cloud is exercising in the playground.White Cloud can walk 1 meters or run k meters per second.Since White Cloud is tired,it can't run fo...

2018-07-21 20:50:20 223

原创 训练日记

看了下昨天的A题,会了之后就感觉很简单,自己想根本就是没有思路,我想用dp ,感觉是一个规律题,怎么都找不到规律,看了大佬的题解,感觉开阔了视野,就是感觉题不能蒙着想,可以画画写写,结合一下图来做题。我还学会了组合数的新算法,不容易,长知识了https://blog.csdn.net/lml11111/article/details/81138776今天看了一个dp题,感觉思路很巧,我做题...

2018-07-20 21:48:52 83

原创 Monotonic Matrix

链接:https://www.nowcoder.com/acm/contest/139/A 题目描述Count the number of n x m matrices A satisfying the following condition modulo (109+7).* Ai, j ∈ {0, 1, 2} for all 1 ≤ i ≤ n, 1 ≤ j ≤ m.* Ai, j...

2018-07-20 21:31:36 492

原创 训练日记

今天做的牛客网的多校练习,感觉就是差点没有签到成功,最后一个题,一直TLE,原因是用了long long ,最后发现去掉就不TLE了,然后改了改就A了。过程很是艰难。。。不过至少签到成功了。https://blog.csdn.net/lml11111/article/details/81123014然后看了看刘大佬做出来的一个题,原来是我想岔了,就是一个暴力深搜,主要解决的问题就是边的选择...

2018-07-19 21:51:27 71

原创 Two Graphs

链接:https://www.nowcoder.com/acm/contest/139/D 题目描述Two undirected simple graphs and where are isomorphic when there exists a bijection on V satisfying  if and only if {x, y} ∈ E2.Given two gr...

2018-07-19 21:26:32 357

原创 Different Integers

链接:https://www.nowcoder.com/acm/contest/139/J 题目描述Given a sequence of integers a1, a2, ..., an and q pairs of integers (l1, r1), (l2, r2), ..., (lq, rq), find count(l1, r1), count(l2, r2), ..., c...

2018-07-19 21:21:23 350

原创 训练日记 7.18

做了两个题,一个是贪心题。我做的时候看到数据不大然后排了一个序就超时了,看到这种题首先就知道是贪心,正确的存放数据的方法是将每一个都存放在数组里,因为苹果的总数据不大。。。但是用到结构体再排序就超时了。用一个dp就实现了贪心。https://blog.csdn.net/lml11111/article/details/81104870最大流+最短路径 这个题没有给你最大流的图,需要自己构建...

2018-07-18 21:36:00 116

原创 HDU 5303 Delicious Apples

http://acm.hdu.edu.cn/showproblem.php?pid=5303题意:有一条环形的长为L的路,仓库在位置0处,这条路上有n棵苹果树,给出每棵苹果树的位置和苹果数量,问用 一次最多能装K个苹果的篮子   把这条路上全部苹果採回仓库最少须要走的距离分析:半环拆成1半,左边的尽可能左走,右边的右走,现在考虑一下绕圈:由于2次绕圈可以拆成左右各来回一次,...

2018-07-18 20:51:37 125

原创 HDU 5294 Tricks Device

http://acm.hdu.edu.cn/showproblem.php?pid=5294题意:1、最少须要切断多少边使吴不能找到张(题意吴仅仅能走最短路径上面的边),对从起点到终点的最短路径又一次建图,每条边的权值为1。求最大流就可以2、在吴能够找到张的前提下,最多能够切断边的数量:仅仅须要在全部最短路径中寻找一条经过边数量最少的最短路径,用边的总数减去它就可以(逆向思维)分析...

2018-07-18 17:21:38 156

原创 训练日记 7.17

昨天看的那个线段树的题,今天做做了一上午,一直wrong,细节很多。而且之前没有见过这样的。在区间更新保留最小值的问题上有很大的难度。深搜的时候还用到了剪枝,就是在区间最大值小于要更新的数的时候就不考虑更新了。这是一个关键点。这个题就只有这两个问题。https://blog.csdn.net/lml11111/article/details/81088721今天下午看到比较简单的找规律的题...

2018-07-17 21:59:57 140

原创 HDU 5301 Buildings

http://acm.hdu.edu.cn/webcontest/contest_showproblem.php?cid=12578&pid=1013&ojid=0题意:矩形中有一个不能通过,问将矩形分成多大的才会使最大的面积最小(要求分成的矩形都必须有窗,即为原矩形的边)分析:可以分成两种情况,1.边都为奇数且相等,x=y=(n+1)/2,此时为特殊情况,答案...

2018-07-17 21:43:33 111

原创 HDU 5306 Gorgeous Sequence

http://acm.hdu.edu.cn/showproblem.php?pid=5306题意:1.区间 [l,r] 对 x 取 min2.区间查询最大值3.区间查询和分析:线段树区间更新查找,查找比较容易,就是按照模板,更新需要进行查找需要更新的点,进行标记,然后通过需要更新点的个数来求和代码:#include<bits/stdc++.h>using ...

2018-07-17 21:24:54 145

基于MFC的IP数据包捕获程序

该程序能捕获本地网卡的IP分组。得到源地址和目的地址,协议。

2018-12-27

空空如也

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

TA关注的人

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