自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(40)
  • 收藏
  • 关注

转载 02更换源

wsl更换软件源。

2022-07-12 11:37:48 183

转载 01安装使用

安装wsl2。

2022-07-12 11:33:42 1335

转载 01创建私钥

生成ssh私钥。

2022-07-12 11:31:02 516

原创 暑假训练 Greg and Graph CodeForces - 295B 最短路

题目描述:Greg has a weighed directed graph, consisting of n vertices. In this graph any pair of distinct vertices has an edge between them in both directions. Greg loves playing with the graph and now he...

2018-10-17 21:17:55 192

原创 暑假训练 Currency Exchange POJ - 1860 最短路

题目描述:Several currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exchange operations only with these currencies. The...

2018-10-17 19:59:39 120

原创 暑假训练 Skiing POJ - 3037 最短路

题目描述:Bessie and the rest of Farmer John’s cows are taking a trip this winter to go skiing. One day Bessie finds herself at the top left corner of an R (1 <= R <= 100) by C (1 <= C <= 100)...

2018-10-15 20:55:04 177 1

原创 暑假训练 MPI Maelstrom POJ - 1502 最短路

题目描述:BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical communication subsystem. Valentine McKee’s researc...

2018-10-11 19:34:14 242

原创 暑假训练 Choose the best route HDU - 2680 最短路

题目描述:One day , Kiki wants to visit one of her friends. As she is liable to carsickness , she wants to arrive at her friend’s home as soon as possible . Now give you a map of the city’s traffic route,...

2018-10-11 17:04:45 108

原创 暑假训练 最短路径问题 HDU - 3790 最短路基础

题目描述:给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的。Input输入n,m,点的编号是1~n,然后是m行,每行4个数 a,b,d,p,表示a和b之间有一条边,且其长度为d,花费为p。最后一行是两个数 s,t;起点s,终点。n和m为0时输入结束。(1<n<=1000, 0&lt...

2018-10-11 12:03:05 242

原创 暑假训练 Protecting the Flowers POJ - 3262 贪心

题目描述:Farmer John went to cut some wood and left N (2 ≤ N ≤ 100,000) cows eating the grass, as usual. When he returned, he found to his horror that the cluster of cows was in his garden eating his bea...

2018-10-10 08:59:15 102

原创 暑假训练 Yogurt factory POJ - 2393 贪心

题目描述:The cows have purchased a yogurt factory that makes world-famous Yucky Yogurt. Over the next N (1 <= N <= 10,000) weeks, the price of milk and labor will fluctuate weekly such that it will...

2018-10-09 20:52:23 252

原创 暑假训练 Stall Reservations POJ - 3190 贪心

题目描述:Oh those picky N (1 <= N <= 50,000) cows! They are so picky that each one will only be milked over some precise time interval A…B (1 <= A <= B <= 1,000,000), which includes both t...

2018-10-09 19:58:20 150

原创 暑假训练 Radar Installation POJ - 1328 贪心

题目描述:Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, locating o...

2018-10-08 18:15:39 123

原创 暑假训练 Food Delivery ZOJ - 3469 区间dp

题目描述:When we are focusing on solving problems, we usually prefer to stay in front of computers rather than go out for lunch. At this time, we may call for food delivery.Suppose there are N people li...

2018-10-08 00:11:50 142

原创 暑假训练 Piggy-Bank HDU - 1114 完全背包

题目描述:Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The idea behind is ...

2018-10-07 15:57:31 123

原创 暑假训练 Common Subsequence HDU - 1159 dp求LCS

题目描述:A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = <x1, x2, …, xm> another sequence Z = <z1, z2, …, zk> is a su...

2018-10-07 15:05:22 113

原创 暑假训练 City Game HDU - 1505 dp

题目描述:Bob is a strategy game programming specialist. In his new city building game the gaming environment is as follows: a city is built up by areas, in which there are streets, trees,factories and bu...

2018-10-07 14:13:03 124

原创 暑假训练 Largest Rectangle in a Histogram HDU - 1506 dp

题目描述:A 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 figure on the left ...

2018-10-07 10:16:23 177

原创 暑假训练 Collecting Bugs POJ - 2096 期望dp

题目描述:Ivan is fond of collecting. Unlike other people who collect post stamps, coins or other material stuff, he collects software bugs. When Ivan gets a new program, he classifies all possible bugs i...

2018-10-05 21:32:03 158

原创 暑假训练 Multiplication Puzzle POJ - 1651 区间dp

在此做一个dp小结吧。背包问题已经说过了,虽然都是最简单的背包问题(太菜了)然后是:区间dp题目大意:一个数组两端数据不能取,每次取出数据所得分数为所取数据与相邻两个数据的乘积,求取出所有数字(不包括两端)后的最小分数。。。POJ - 1651#include<cstdio>#include<algorithm>#include<cstring

2018-10-05 21:27:41 119

原创 暑假训练 Cash Machine POJ - 1276 背包问题

题目描述:A Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine uses exactly N distinct bill denominations, say...

2018-10-04 16:24:26 95

原创 暑假训练 欧拉回路

欧拉回路这个专题的入门也差不多了,总结下吧。一般用可达矩阵来存储图,然后判断欧拉回路,首先判断出度和入度是否满足欧拉回路的要求(即入度等于出度,或欧拉通路仅有两点入度比出度大一,出度比入度大一)代码:int in[n];bool judge(){ for(int i = 0; i < n; i++) { if(in[i] % 2 != 0)retur...

2018-09-27 00:29:15 167

原创 暑假训练 John's trip POJ - 1041 欧拉回路

题目描述:Little Johnny has got a new car. He decided to drive around the town to visit his friends. Johnny wanted to visit all his friends, but there was many of them. In each street he had one friend. H...

2018-09-27 00:04:28 192

原创 暑假训练 The Necklace UVA - 10054 欧拉回路

题目描述:My little sister had a beautiful necklace made of colorful beads. Two successive beads in the necklace shared a common color at their meeting point. The figure below shows a segment of the neckl...

2018-09-26 23:50:28 166

原创 暑假训练 Play on Words (UVA - 10129) 欧拉回路

题目描述:Some of the secret doors contain a very interesting word puzzle. The team of archaeologists has to solve it to open that doors. Because there is no other way to open the doors, the puzzle is ver...

2018-09-25 11:07:50 199

原创 暑假训练 Reward HDU - 2647 拓扑排序

题目描述:Dandelion’s uncle is a boss of a factory. As the spring festival is coming , he wants to distribute rewards to his workers. Now he has a trouble about how to distribute the rewards.The workers ...

2018-09-24 20:54:13 117

原创 暑假训练 Ordering Tasks UVA - 10305 拓扑排序

描述:John has n tasks to do. Unfortunately, the tasks are not independent and the execution of one task is only possible if other tasks have already been executed.InputThe input will consist of sever...

2018-09-23 15:58:22 99

原创 暑假训练 确定比赛名次 HDU - 1285 拓扑排序

描述:有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时P1在P2之前。现在请你编程序确定排名。Input输入有若干组,每组中的第一行为二个数N(1<=N<=500),M;其中N...

2018-09-23 15:53:44 87

原创 暑假训练 Battle City (OpenJ_Bailian - 2312)bfs +优先队列

描述:Many of us had played the game “Battle city” in our childhood, and some people (like me) even often play it on computer now.What we are discussing is a simple edition of this game. Given a map t...

2018-09-23 12:34:01 250

原创 暑假训练 生日蛋糕 OpenJ_Bailian - 1190 (dfs+剪枝)

题目描述:7月17日是Mr.W的生日,ACM-THU为此要制作一个体积为Nπ的M层生日蛋糕,每层都是一个圆柱体。设从下往上数第i(1 <= i <= M)层蛋糕是半径为Ri, 高度为Hi的圆柱。当i < M时,要求Ri > Ri+1且Hi > Hi+1。由于要在蛋糕上抹奶油,为尽可能节约经费,我们希望蛋糕外表面(最下一层的下底面除外)的面积Q最小。

2018-09-23 01:56:35 192

原创 暑假训练 The Triangle Game (OpenJ_Bailian - 1574)

题目描述:In the triangle game you start off with six triangles numbered on each edge, as in the example above. You can slide and rotate the triangles so they form a hexagon, but the hexagon is only lega...

2018-09-23 00:26:08 316

原创 暑假训练 HDU 2102 A计划(两层bfs)

题目描述: 可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而今,不幸的她再一次面临生命的考验。魔王已经发出消息说将在T时刻吃掉公主,因为他听信谣言说吃公主的肉也能长生不老。年迈的国王正是心急如焚,告招天下勇士来拯救公主。不过公主早已习以为常,她深信智勇的骑士LJ肯定能将她救出。 现据密探所报,公主被关在一个两层的迷宫里,迷宫的入口是S(0,0,0),公主的位置用P表示,时空传输机用#...

2018-09-17 18:32:00 101

原创 暑假训练 HDU 2102 A计划(两层dfs)

题目描述: 可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而今,不幸的她再一次面临生命的考验。魔王已经发出消息说将在T时刻吃掉公主,因为他听信谣言说吃公主的肉也能长生不老。年迈的国王正是心急如焚,告招天下勇士来拯救公主。不过公主早已习以为常,她深信智勇的骑士LJ肯定能将她救出。 现据密探所报,公主被关在一个两层的迷宫里,迷宫的入口是S(0,0,0),公主的位置用P表示,时空传输机用#...

2018-09-17 17:12:16 114

原创 暑假训练 迷宫寻宝(bfs)

题目描述 洪尼玛今天准备去寻宝,在一个n*n (n行, n列)的迷宫中,存在着一个入口、一些墙壁以及一个宝藏。由于迷宫是四连通的,即在迷宫中的一个位置,只能走到与它直接相邻的其他四个位置(上、下、左、右)。现洪尼玛在迷宫的入口处,问他最少需要走几步才能拿到宝藏?若永远无法拿到宝藏,则输出-1。Input 多组测试数据。每组数据输入第一行为正整数n,表示迷宫大小。接下来n行,每行包括...

2018-09-17 01:10:32 1431

原创 补个水题 :数水坑

描述 Due to recent rains, water has pooled in various places in Farmer John’s field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100) squares. Each square contain...

2018-09-17 01:05:21 432

原创 Tsinghua mooc 数据结构上 列车调度(Train) 栈混洗

描述 某列车调度站的铁道联接结构如Figure 1所示。其中,A为入口,B为出口,S为中转盲端。所有铁道均为单轨单向式:列车行驶的方向只能是从A到S,再从S到B;另外,不允许超车。因为车厢可在S中驻留,所以它们从B端驶出的次序,可能与从A端驶入的次序不同。不过S的容量有限,同时驻留的车厢不得超过m节。设某列车由编号依次为{1, 2, …, n}的n节车厢组成。调度员希望知道,按照以上交通...

2018-09-12 21:33:11 1550 2

原创 Tsinghua mooc 数据结构上 灯塔(LightHouse) 归并排序

描述 海上有许多灯塔,为过路船只照明。每个灯塔都配有一盏探照灯,照亮其东北、西南两个对顶的直角区域。探照灯的功率之大,足以覆盖任何距离。灯塔本身是如此之小,可以假定它们不会彼此遮挡。若灯塔A、B均在对方的照亮范围内,则称它们能够照亮彼此。现在,对于任何一组给定的灯塔,请计算出其中有多少对灯塔能够照亮彼此。 输入 共n+1行。 第1行为1个整数n,表示灯塔的总数。 第2到n+1...

2018-09-09 21:32:36 1059

原创 Tsinghua mooc 数据结构上 祖玛(Zuma) List

Description Let’s play the game Zuma!There are a sequence of beads on a track at the right beginning. All the beads are colored but no three adjacent ones are allowed to be with a same color. You c...

2018-09-09 21:08:56 785

原创 Tsinghua mooc 数据结构上 范围查询(Range) 快排+二分

先补一波mooc上数据结构的题,题面如下: Descriptioin Let S be a set of n integral points on the x-axis. For each given interval [a, b], you are asked to count the points lying inside.Input The first line contains ...

2018-09-09 20:53:38 1337

原创 假期开始搞ACM了,就随手找个地方记录下吧T-T

第一篇博客就这么给了ACM, 之后把自己学到的算法和水到的题都记录下来吧, 坚持刷题!!

2018-08-08 16:26:33 123

空空如也

空空如也

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

TA关注的人

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