自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Coldfresh的博客

keeeeeep!~

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

原创 二分图最大匹配

来自裸题:过山车 HDU - 2063 代码:import java.util.Arrays;import java.util.Scanner;public class Main{ final static int maxn=1005; final static int maxx=2005; final static int INF =0x3f3f3...

2018-05-24 21:04:35 193

原创 最大流(dinic算法)

题目来源Drainage Ditches HDU - 1532 ,裸的最大流 代码: 选用dinic有如下优势 1.代码量小,容易记忆。 2.效率上比EK算法快很多,虽然比asp稍慢,但是是可以接受的。import java.util.Arrays;import java.util.Scanner;public class Main{ final static...

2018-05-24 21:03:37 1233

原创 无向图的边双连通分量(FROM Redundant Paths POJ - 3177 )

In order to get from one of the F (1 <= F <= 5,000) grazing fields (which are numbered 1..F) to another field, Bessie and the rest of the herd are forced to cross near the Tree of Rotten Apples....

2018-05-17 19:51:23 321

原创 无向图的桥

没有具体例图,就是直接找出,那些边是桥。import java.util.Arrays;import java.util.Scanner;public class Main{ static int SIZE=100010; static int head[]=new int[SIZE],to[]=new int[SIZE<<1],next[]=ne...

2018-05-17 19:07:51 1238

原创 有向图的强连通分量

HDU - 2767(强连通分量) 求一个有向图里加最少的边使得任意两点可达。。import java.util.ArrayList;import java.util.Arrays;import java.util.LinkedList;import java.util.Queue;import java.util.Scanner;public class Main{ ...

2018-05-17 19:04:51 474

原创 倍增LCA

There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this “How far is it if I want to go from house A to house B”? Usually it hard to...

2018-05-15 19:33:07 348

原创 直径 HYSBZ - 3124(树的直径)

小Q最近学习了一些图论知识。根据课本,有如下定义。树:无回路且连通的无向图,每条边都有正整数的权值来表示其长度。如果一棵树有N个节点,可以证明其有且仅有N-1 条边。 路径:一棵树上,任意两个节点之间最多有一条简单路径。我们用 dis(a,b) 表示点a和点b的路径上各边长度之和。称dis(a,b)为a、b两个节点间的距离。 直径:一棵树上,最长的路径为树的直径。树的直径可能不是唯一的。 ...

2018-05-15 18:02:34 288

原创 「Poetize9」升降梯上(tyvj2032)(最短路)

开启了升降梯的动力之后,探险队员们进入了升降梯运行的那条竖直的隧道,映入眼帘的是一条直通塔顶的轨道、一辆停在轨道底部的电梯、和电梯内一杆控制电梯升降的巨大手柄。 Nescafe之塔一共有N层,升降梯在每层都有一个停靠点。手柄有M个控制槽,第i个控制槽旁边标着一个数Ci,满足C1<C2<C3<……<CMC1<C2<C3<……<CMC_

2018-05-14 19:44:52 1043

原创 Sudoku POJ - 3074(DFS)

Sudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure. In some of the cells are written decimal digits from 1 to 9. The othe...

2018-05-10 21:14:30 323

原创 Booksort POJ - 3460 (IDA*)

The Leiden University Library has millions of books. When a student wants to borrow a certain book, he usually submits an online loan form. If the book is available, then the next day the student can ...

2018-05-10 16:43:48 291

原创 Nightmare Ⅱ HDU - 3085(双向BFS)

Last night, little erriyue had a horrible nightmare. He dreamed that he and his girl friend were trapped in a big maze separately. More terribly, there are two ghosts in the maze. They will kill the p...

2018-05-09 15:22:09 287

原创 Java输入输出流相关

读取控制台输入: 这种是从控制台读入字节流的一般写法;BufferedReaderr br=new BufferedReader(new InputStreamReader(System.in));从控制台读取多字符输入: 然后我们从br对象用read(),写法如下: (每次调用 read() 方法,它从输入流读取一个字符并把该字符作为整数值返回。 当流结束的时候返回 -1。该方...

2018-05-07 19:17:21 130

原创 18年ACM山东省赛随想

昨天正式赛打完了,有遗憾也有惊喜。至少圆了我的省赛的心愿。真的的是爆人品了,前一天热身赛打得太好了。直接到了rank5。当时的B题只是想验证一下想法,没想到直接过了,也让我心里很不安。后来疯狂waA,想弥补一下…坐在后面的是山大的大一队伍,热身赛刚结束了,就过来问我B题的解法,然后解答了一番。。。山大的学生果然不一般,即使是热身赛。从这里就可以看出,应该可以在未来的区域赛再次看到他们。但...

2018-05-07 12:41:31 449

原创 Editor HDU - 4699 (模拟)

Input 8 I 2 I -1 I 1 Q 3 L D R Q 2 Output 2 3思路:就是模拟了,关键是怎么模拟了,这里用两个栈,如果左移就做边出栈,然后压到右边的栈。通过两个栈来模拟光标左右移动,其也就差不多了。 代码:#include<iostream>#include<cstdio>#include<sta...

2018-05-03 14:11:38 260

原创 Coconuts HDU - 5925(二维离散化

TanBig, a friend of Mr. Frog, likes eating very much, so he always has dreams about eating. One day, TanBig dreams of a field of coconuts, and the field looks like a large chessboard which has R rows ...

2018-05-02 14:16:34 483

空空如也

空空如也

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

TA关注的人

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