自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

OlaMins

图论&数据结构

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

原创 #牛客网 kotori和素因子 (求因子 + DFS)

kotori拿到了一些正整数。她决定从每个正整数取出一个素因子。但是,kotori有强迫症,她不允许两个不同的正整数取出相同的素因子。她想知道,最终所有取出的数的和的最小值是多少?注:若a%k==0,则称k是a的因子。若一个数有且仅有两个因子,则称其是素数。显然1只有一个因子,不是素数。输入描述:第一行一个正整数n,代表kotori拿到正整数的个数。...

2019-06-29 21:53:52 1245

原创 #HDU 4857 逃生 (拓扑排序 + 反向建图 + 原理)

逃生Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9657Accepted Submission(s): 2748Problem Description糟糕的事情发生啦,现在大家都忙着逃命。但是逃命的通道很窄,大...

2019-06-26 17:02:51 265 1

原创 #HDU 5695 Gym Class (拓扑排序)

Gym ClassTime Limit: 6000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2637Accepted Submission(s): 981Problem Description众所周知,度度熊喜欢各类体育活动。今天,它终于...

2019-06-26 16:13:45 127

原创 #HDU 1811 Rank of Tetris (拓扑排序 + 并查集)

Rank of TetrisTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13306Accepted Submission(s): 3780Problem Description自从Lele开发了Rating系统...

2019-06-26 15:43:38 150

原创 #HDU 2647 Reward (拓扑排序 + 反向建图 )

RewardTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 14966Accepted Submission(s): 4795Problem DescriptionDandelion's uncle is a bo...

2019-06-25 23:22:39 157

原创 #牛客网 吐泡泡 (栈)

题目描述小鱼儿吐泡泡,嘟嘟嘟冒出来。小鱼儿会吐出两种泡泡:大泡泡"O",小泡泡"o"。两个相邻的小泡泡会融成一个大泡泡,两个相邻的大泡泡会爆掉。(是的你没看错,小气泡和大气泡不会产生任何变化的,原因我也不知道。)例如:ooOOoooO经过一段时间以后会变成oO。输入描述:数据有多组,处理到文件结束。每组输入包含一行仅有'O'与'o'组成的字符串。输出描述:...

2019-06-23 22:30:19 761

原创 #牛客网 大吉大利,今晚吃鸡——跑毒篇 (模拟)

题目描述现在有一款很火的游戏playerunknown's battlegrounds,人称“吃鸡”,在里面经常面临跑毒(从安全区外跑进安全区内)的问题,在安全区外,人们会处于中毒状态,每秒会掉a%血,人们可以通过使用道具急救包把血量升回到80%,使用急救包需要原地站着6秒。现在知道在安全区外扣血速度为a%/s,角色和安全区的距离为b米,角色跑步速度为1m/s,角色有c个急救包...

2019-06-23 16:06:54 329

原创 #二进制乘法 (输入输出皆为二进制)

在讲二进制乘法之前,我们先看下十进制的乘法,比如这个例子:其实乘法就是每一位数乘完之后的结果相加,136 + 170 = 306, 二进制也是一样的,其实进制只是一种表现形式而已,原理都没啥差别。具体题目可以看下这道https://ac.nowcoder.com/acm/contest/945/JAC代码 :#include<bits/stdc++.h>u...

2019-06-22 21:20:15 3521

原创 #POJ 3255 Roadblocks (可重复次短路) dijkstra + 链式前向星

RoadblocksTime Limit: 2000MS Memory Limit: 65536K Total Submissions: 22083 Accepted: 7677 DescriptionBessie has moved to a small farm and sometimes enjoys returning to visit on...

2019-06-22 17:40:09 178

原创 #HDU 1257 最少拦截系统 (LIS 二分 + 贪心)

最少拦截系统Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 68468Accepted Submission(s): 26578Problem Description某国为了防御敌国的导弹袭击,发展出一种导弹拦截系...

2019-06-21 19:54:15 193

原创 #HDU 3836 Equivalent Sets (tarjan添加最少边强连通)

Equivalent SetsTime Limit: 12000/4000 MS (Java/Others)Memory Limit: 104857/104857 K (Java/Others)Total Submission(s): 6583Accepted Submission(s): 2374Problem DescriptionTo prove two s...

2019-06-21 10:32:45 142

原创 POJ 3352 Road Construction(无向图缩点)

DescriptionIt's almost summer time, and that means that it's almost summer construction time! This year, the good people who are in charge of the roads on the tropical island paradise of Remote Isla...

2019-06-20 16:11:42 219

原创 #POJ 3177 Redundant Paths (无向图缩点)

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

2019-06-20 15:51:12 227

原创 #HDU 4635 Strongly connected (tarjan + 原理)

Problem DescriptionGive a simple directed graph with N nodes and M edges. Please tell me the maximum number of the edges you can add that the graph is still a simple directed graph. Also, after you ...

2019-06-20 11:09:12 168

原创 #HDU 4738 Caocao‘s Bridges(割边)巨坑!

Problem DescriptionCaocao was defeated by Zhuge Liang and Zhou Yu in the battle of Chibi. But he wouldn't give up. Caocao's army still was not good at water battles, so he came up with another idea....

2019-06-19 16:38:02 321

原创 #POJ 1144 Network (割点)

A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numbered by integers from 1 to N . No two places have the same number. The lines are bi...

2019-06-19 10:33:14 124

原创 POJ 1273 Drainage Ditches (网络流 最大流)

DescriptionEvery time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long time to reg...

2019-06-18 15:56:59 156

原创 #POJ 1236 Network of Schools(Tarjan)

DescriptionA number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it distributes software (the ...

2019-06-17 23:03:58 112

原创 #HDU 1242 Rescue (BFS + 优先队列)

Problem DescriptionAngel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, ROADs, and GUARDs in the prison....

2019-06-16 23:03:05 108

原创 #牛客网 PUBG (bfs + 优先队列)

最近,喜爱ACM的PBY同学沉迷吃鸡,无法自拔,于是又来到了熟悉的ERANGEL。经过一番搜寻,PBY同学准备动身前往安全区,但是,地图中埋伏了许多LYB,PBY的枪法很差,希望你能够帮他找到一条路线,每次只能向上、下、左、右移动,尽可能遇到较少的敌人。输入描述:题目包含多组测试,请处理到文件结束;第一行是一个整数n,代表地图的大小;接下来的n行中,每行包含n个整数a,每个...

2019-06-16 22:47:32 362

原创 #HDU 1253 胜利大逃亡

Problem DescriptionIgnatius被魔王抓走了,有一天魔王出差去了,这可是Ignatius逃亡的好机会.魔王住在一个城堡里,城堡是一个A*B*C的立方体,可以被表示成A个B*C的矩阵,刚开始Ignatius被关在(0,0,0)的位置,离开城堡的门在(A-1,B-1,C-1)的位置,现在知道魔王将在T分钟后回到城堡,Ignatius每分钟能从一个坐标走到相邻的六个坐标中的其...

2019-06-16 16:31:25 113

原创 #HDU 1010 Tempter of the Bone (DFS + 剪枝)

The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He realized that the bone ...

2019-06-16 15:47:44 126

原创 #HDU1181 变形课 (DFS + 词语接龙)

呃......变形课上Harry碰到了一点小麻烦,因为他并不像Hermione那样能够记住所有的咒语而随意的将一个棒球变成刺猬什么的,但是他发现了变形咒语的一个统一规律:如果咒语是以a开头b结尾的一个单词,那么它的作用就恰好是使A物体变成B物体.Harry已经将他所会的所有咒语都列成了一个表,他想让你帮忙计算一下他是否能完成老师的作业,将一个B(ball)变成一个M(Mouse),你知道,如果他...

2019-06-16 14:24:50 167

原创 #HDU 2952 Counting Sheep (DFS + 连通块)

A while ago I had trouble sleeping. I used to lie awake, staring at the ceiling, for hours and hours. Then one day my grandmother suggested I tried counting sheep after I'd gone to bed. As always when...

2019-06-16 13:46:31 166

原创 #HDU 1241 Oil Deposits (dfs求连通块)

Problem DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a...

2019-06-15 23:23:12 109

原创 #HDU 1312 Red and Black (联通块问题)

roblem DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacen...

2019-06-15 22:14:07 119

原创 #HDU 1716 (全排列)

Problem DescriptionRay又对数字的列产生了兴趣:现有四张卡片,用这四张卡片能排列出很多不同的4位数,要求按从小到大的顺序输出这些4位数。Input每组数据占一行,代表四张卡片上的数字(0<=数字<=9),如果四张卡片都是0,则输入结束。Output对每组卡片按从小到大的顺序输出所有能由这四张卡片组成的4位数,千位数字相同...

2019-06-15 21:55:22 678

原创 #POJ 2752 Seek the Name, Seek the Fame (KMP)

DescriptionThe little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. They seek the name, and at the same...

2019-06-13 23:18:25 123

原创 #牛客网 通知小弟 (tarjan + 思维)

在战争时期,A国派出了许多间谍到其他国家去收集情报。因为间谍需要隐秘自己的身份,所以他们之间只是单向联系。所以,某个间谍只能单向联系到一部分的间谍。同时,间谍也不知道跟他联系的是谁。HA是间谍们的老大,但他也只能联系到部分的间谍。HA现在有一项命令有告诉所有的间谍。HA想要知道他至少要告诉多少个他能联系上的间谍才能通知到所有的间谍。输入描述:有多个测试数据。对于每个测试数据:...

2019-06-13 16:35:51 346

原创 #HDU 2594 Simpsons’ Hidden Talents (KMP)

Problem DescriptionHomer: Marge, I just figured out a way to discover some of the talents we weren’t aware we had.Marge: Yeah, what is it?Homer: Take me for example. I want to find out if I have a...

2019-06-13 15:01:34 233

原创 #HDU 2087 剪花布条 (KMP)

Problem Description一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢?Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过1000个字符长。...

2019-06-13 14:53:39 227

原创 #HDU 3746 Cyclic Nacklace (KMP + 循环填补 原理)

Problem DescriptionCC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are only 99.9 yuan left. he is too distressed and ...

2019-06-12 23:40:51 131

原创 #POJ 2406 Power Strings (KMP)

DescriptionGiven two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concatenation as multiplication, exponentiat...

2019-06-12 17:04:40 128

原创 #POJ 1961 Period (KMP)

DescriptionFor each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. That is, f...

2019-06-12 16:58:01 125

原创 #HDU 1711 Number Sequence(KMP)

Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K which make a[K] = b[1], a[K ...

2019-06-12 14:37:37 120

原创 #HDU 1827 (tarjan + 简单原理)

Problem DescriptionTo see a World in a Grain of SandAnd a Heaven in a Wild Flower,Hold Infinity in the palm of your handAnd Eternity in an hour.—— William Blake听说lcy帮大家预定了新马泰7...

2019-06-11 16:57:48 135

原创 #HDU 2767 (tarjan + 原理)

Problem DescriptionConsider the following exercise, found in a generic linear algebra textbook.Let A be an n × n matrix. Prove that the following statements are equivalent:1. A is invertible.2. A...

2019-06-11 15:17:23 200

原创 #HDU 2444The Accomodation of Students (二分图的判别方法及最大匹配 原理)

Problem DescriptionThere are a group of students. Some of them may know each other, while others don't. For example, A and B know each other, B and C know each other. But this may not imply that...

2019-06-10 16:48:04 138

原创 #POJ 2239 Selecting Courses (匈牙利算法 / 二分图的最大匹配)

DescriptionIt is well known that it is not easy to select courses in the college, for there is usually conflict among the time of the courses. Li Ming is a student who loves study every much, and at...

2019-06-10 14:13:07 203

原创 #HDU 1269 迷宫城堡 (tarjan)

Problem Description为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个房间(N<=10000)和M条通道(M<=100000),每个通道都是单向的,就是说若称某通道连通了A房间和B房间,只说明可以通过这个通道由A房间到达B房间,但并不说明通过它可以由B房间到达A房间。Gardon需要请你写个程序确认一下是否任意两个房间都是相互连通的,即:对于任意的i和...

2019-06-10 10:44:05 121

空空如也

空空如也

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

TA关注的人

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