自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

HJY

一只想要翻身的咸鱼

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

原创 模板总结

属于自己的模板。。。比赛防忘记赛前复习向

2017-07-24 10:25:30 1537 1

原创 HDU 4109 Instrction Arrangement(拓扑排序+bfs)

Ali has taken the Computer Organization and Architecture course this term. He learned that there may be dependence between instructions, like WAR (write after read), WAW, RAW. If the distance between two instructions is less than the Safe Distance, it wil

2017-07-31 20:53:24 513

原创 HDU 3397 Sequence operation(线段树的区间合并)

lxhgww got a sequence contains n characters which are all '0's or '1's. We have five operations here: Change operations: 0 a b change all characters into '0's in [a , b] 1 a b change all characters into '1's in [a , b] 2 a b change all '0's into '1's

2017-07-31 17:07:34 382

原创 HDU 1806 Frequent values(线段树+离散化+二分)

You are given a sequence of n integers a1 , a2 , ... , an in non-decreasing order. In addition to that, you are given several queries consisting of indices i and j (1 ≤ i ≤ j ≤ n). For each query, determine the most frequent value among the integers ai , .

2017-07-30 16:46:47 393

原创 HDU 4578 Transformation(线段树+做了4天的神题+详解)

Yuanfang is puzzled with the question below: There are n integers, a 1, a 2, …, a n. The initial values of them are 0. There are four kinds of operations. Operation 1: Add c to each number between a x and a y inclusive. In other words, do transformation

2017-07-29 21:17:11 1752 1

原创 POJ 2502 Subway(将各种数据转化成图+最短路+迪杰斯特拉算法)

You have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of getting to ride your bike to school every day, you now get to walk and take the subway. Because you don't want to be late for class, you want to know how long it will

2017-07-27 19:18:27 556

原创 POJ 2367 Genealogical tree(拓扑排序+dfs)

The system of Martians' blood relations is confusing enough. Actually, Martians bud when they want and where they want. They gather together in different groups, so that a Martian can have one parent as well as ten. Nobody will be surprised by a hundred of

2017-07-27 18:59:13 542

原创 POJ 1389 Area of Simple Polygons(线段树+扫描线+离散化)

There are N, 1 <= N <= 1,000 rectangles in the 2-D xy-plane. The four sides of a rectangle are horizontal or vertical line segments. Rectangles are defined by their lower-left and upper-right corner points. Each corner point is a pair of two nonnegative in

2017-07-27 18:54:49 586

原创 HDU 1301 Jungle Roads(最小生成树+克鲁斯卡尔算法)

The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle overtakes roads relentlessly, so the large road network is too expensive to maintain. Th

2017-07-27 18:47:15 528

原创 HDU 3333 Turing Tree(离线操作+线段树||树状数组)

After inventing Turing Tree, 3xian always felt boring when solving problems about intervals, because Turing Tree could easily have the solution. As well, wily 3xian made lots of new problems about intervals. So, today, this sick thing happens again... No

2017-07-27 09:45:12 455

原创 HDU 4614 Vases and Flowers (二分查找+线段树区间更新)

Alice is so popular that she can receive many flowers everyday. She has N vases numbered from 0 to N-1. When she receive some flowers, she will try to put them in the vases, one flower in one vase. She randomly choose the vase A and try to put a flower in

2017-07-26 20:54:08 673

原创 ZOJ 2103 Marco Popo the Traveler(dfs+欧拉路)

Marco Popo, the famous traveler, is traveling around the country of ACM. There are colored high-ways between cities (of course there is at most one high-way between any two cities), and his goal is to drive along each high-way once and only once. There is

2017-07-26 15:19:49 499

原创 POJ 2155 Matrix(二维树状数组+数组数组区间更新+单点查询)

Given an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in the i-th row and j-th column. Initially we have A[i, j] = 0 (1 <= i, j <= N). We can change the matrix in the following way. Given a rectangle whose upper-left corner is

2017-07-26 11:11:08 1458

原创 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.

2017-07-26 09:37:40 301

原创 POJ 3356 AGTC(dp之公共最长子序列)

Let x and y be two strings over some finite alphabet A. We would like to transform xinto y allowing only operations given below:Deletion: a letter in x is missing in y at a corresponding position.Insertion: a letter in y is missing in x at a correspondin

2017-07-25 16:50:07 395

原创 POJ 3617 Best Cow Line(模拟+贪心)

FJ is about to take his N (1 ≤ N ≤ 30,000) cows to the annual"Farmer of the Year" competition. In this contest every farmer arranges his cows in a line and herds them past the judges.The contest organizers adopted a new registration scheme this year: simp

2017-07-25 15:58:45 310

原创 POJ 3199 Uncle Jack(高精度加速乘)

Dear Uncle Jack is willing to give away some of his collectable CDs to his nephews. Among the titles you can find very rare albums of Hard Rock, Classical Music, Reggae and much more; each title is considered to be unique. Last week he was listening to one

2017-07-25 15:53:27 485

原创 CodeForces 370 B.Berland Bingo(模拟)

Lately, a national version of a bingo game has become very popular in Berland. There are n players playing the game, each player has a card with numbers. The numbers on each card are distinct, but distinct cards can have equal numbers. The card of the i-th

2017-07-25 15:46:33 347

原创 POJ 2528 Mayor's posters(离散化+线段树)

The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council has finally decided to build an electoral wall for placing the poster

2017-07-25 11:33:45 315

原创 POJ 2828 Buy Tickets(线段树的单点更新)

Railway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue…The Lunar New Year was approaching, but unluckily the Little Cat still had schedules going here and there. Now, he had to travel by tra

2017-07-24 22:09:12 280

原创 HDU 1754 I Hate It (线段树+单点更新+区间询问)

很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。

2017-07-24 19:10:13 315

原创 WUST 2050 三维迷宫(bfs)

你现在处于一栋楼里的'S'的起始位置,'#'是墙壁,'.'是路,'E'是重点,'U'的楼梯代表你可以上去一层,'D'的楼梯代表你可以下去一层(保证上去跟下去的地方不会是墙壁)。请你告诉我至少要多少步才能到达终点,当然有可能去不到重点,这时请输出"Trapped!"

2017-07-24 15:38:10 443

原创 WUST 1934 最小花费(最短路+迪杰斯特拉)

在n个人中,某些人的银行账号之间可以互相转账。这些人之间转账的手续费各不相同。给定这些人之间转账时需要从转账金额里扣除百分之几的手续费,请问A最少需要多少钱使得转账后B收到100元。

2017-07-24 15:02:47 532

原创 WUST 1888 乘积最大(dp)

今年是国际数学联盟确定的“2000——世界数学年”,又恰逢我国著名数学家华罗庚先生诞辰90周年。在华罗庚先生的家乡江苏金坛,组织了一场别开生面的数学智力竞赛的活动,你的一个好朋友XZ也有幸得以参加。活动中,主持人给所有参加活动的选手出了这样一道题目: 设有一个长度为N的数字串,要求选手使用K个乘号将它分成K+1个部分,找出一种分法,使得这K+1个部分的乘积最大。 同时,为了帮助选手能够正确理解题意,主持人还举了如下的一个例子: 有一个数字串:312, 当N=3,K=1时会有以下两种分

2017-07-24 11:39:22 368

原创 POJ 3670 Eating Together(dp)

The cows are so very silly about their dinner partners. They have organized themselves into three groups (conveniently numbered 1, 2, and 3) that insist upon dining together. The trouble starts when they line up at the barn to enter the feeding area.Each

2017-07-23 21:59:27 298

原创 POJ 3481 Double Queue(STL之双向优先队列)

The new founded Balkan Investment Group Bank (BIG-Bank) opened a new office in Bucharest, equipped with a modern computing environment provided by IBM Romania, and using modern information technologies. As usual, each client of the bank is identified by a

2017-07-23 21:53:31 1085

原创 HDU 1969 Pie(二分+模拟)

My 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 coming to my party and each of them gets a piece of pie. This should be one piece of on

2017-07-23 21:46:50 340

原创 POJ 3895 Cycles of Lanes(dfs+模拟)

Each of the M lanes of the Park of Polytechnic University of Bucharest connects two of the N crossroads of the park (labeled from 1 to N). There is no pair of crossroads connected by more than one lane and it is possible to pass from each crossroad to each

2017-07-18 17:46:37 354

原创 POJ 1405 Heritage(模拟+高精度乘法)

Your rich uncle died recently, and the heritage needs to be divided among your relatives and the church (your uncle insisted in his will that the church must get something). There are N relatives (N <= 18) that were mentioned in the will. They are sorted i

2017-07-18 17:38:30 563

原创 HDU 1828 Picture (线段树+扫描线+离散化)

A number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertical or horizontal. Each rectangle can be partially or totally covered by the others. The length of the boundary of the union of

2017-07-18 09:02:00 515

原创 几个有用的STL函数和编程中的一些细节处理

几个有用的STL函数和编程中的一些细节处理

2017-07-17 21:01:11 481

原创 POJ 1840 Eqs(模拟+哈希)

Consider equations having the following form: a1x1 3+ a2x2 3+ a3x3 3+ a4x4 3+ a5x5 3=0 The coefficients are given integers from the interval [-50,50]. It is consider a solution a system (x1, x2, x3, x4, x5) that verifies the equation, xi∈[-50,50], xi !=

2017-07-17 14:02:37 658

原创 HDU 1789 Doing Homework again(贪心)

Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in the homework after the deadline, the teacher will reduce his score of the fin

2017-07-17 10:38:27 283

原创 HDU 1540 Tunnel Warfare(线段树区间合并)

During the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Generally speaking, villages connected by tunnels lay in a line. Except the two at the ends, every village was directly connected

2017-07-16 21:03:25 336

原创 WUST 1933 牛的旅行(超难理解的题意+Floyd)

农民John的农场里有很多牧区。有的路径连接一些特定的牧区。一片所有连通的牧区称为一个牧场。但是就目前而言,你能看到至少有两个牧区不连通。现在,John想在农场里添加一条路径 ( 注意,恰好一条 )。对这条路径有这样的限制:一个牧场的直径就是牧场中最远的两个牧区的距离 ( 本题中所提到的所有距离指的都是最短的距离 )。 每一个牧区都有自己的坐标。假如John的农场有2个牧场,第一个牧场有5个牧区A(10,10),B(15,10),C(20,10),D(15,15)和E(20,15)。第二个农

2017-07-16 10:22:35 499

原创 WUST 1947 联络员(最小生成树+部分连好的点)

Tyvj已经一岁了,网站也由最初的几个用户增加到了上万个用户,随着Tyvj网站的逐步壮大,管理员的数目也越来越多,现在你身为Tyvj管理层的联络员,希望你找到一些通信渠道,使得管理员两两都可以联络(直接或者是间接都可以)。Tyvj是一个公益性的网站,没有过多的利润,所以你要尽可能的使费用少才可以。 目前你已经知道,Tyvj的通信渠道分为两大类,一类是必选通信渠道,无论价格多少,你都需要把所有的都选择上;还有一类是选择性的通信渠道,你可以从中挑选一些作为最终管理员联络的通信渠道。数据保证给出的通行渠道可以

2017-07-16 08:44:41 502

原创 WUST 1946 繁忙的都市(最小生成树+克鲁斯卡尔算法)

城市C是一个非常繁忙的大都市,城市中的道路十分的拥挤,于是市长决定对其中的道路进行改造。城市C的道路是这样分布的:城市中有n个交叉路口,有些交叉路口之间有道路相连,两个交叉路口之间最多有一条道路相连接。这些道路是双向的,且把所有的交叉路口直接或间接的连接起来了。每条道路都有一个分值,分值越小表示这个道路越繁忙,越需要进行改造。但是市政府的资金有限,市长希望进行改造的道路越少越好,于是他提出下面的要求:改造的那些道路能够把所有的交叉路口直接或间接的连通起来。在满足要求1的情况下,改造的道路尽量少。在满足

2017-07-15 21:20:05 406

原创 WUST 1944 最短网络Agri-Net(最小生成树之prim算法)

农民约翰被选为他们镇的镇长!他其中一个竞选承诺就是在镇上建立起互联网,并连接到所有的农场。当然,他需要你的帮助。约翰已经给他的农场安排了一条高速的网络线路,他想把这条线路共享给其他农场。为了用最小的消费,他想铺设最短的光纤去连接所有的农场。你将得到一份各农场之间连接费用的列表,你必须找出能连接所有农场并所用光纤最短的方案。每两个农场间的距离不会超过100000。

2017-07-15 19:58:03 425

原创 POJ 3468 A Simple Problem with Integers (树状数组成段更新)

Let A1, A2, ... , AN be N elements. You need to deal with two kinds of operations. One type of operation is to add a given number to a few numbers in a given interval. The other is to query the value of some element.

2017-07-15 18:30:35 353

原创 WUST 1949 家谱树(拓扑排序+dfs)

有个人的家族很大,辈分关系很混乱,请你帮整理一下这种关系。给出每个人的孩子的信息。输出一个序列,使得每个人的后辈都比那个人后列出。

2017-07-15 14:11:37 583

空空如也

空空如也

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

TA关注的人

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