![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
搜索
文章平均质量分 80
nudt_oys
An AC a day,keeps WA away~
展开
-
CCF CSP 2015年12月第3题 画图 (模拟+DFS或BFS)
问题描述试题编号:201512-3试题名称:画图时间限制:1.0s内存限制:256.0MB问题描述:问题描述 用 ASCII 字符来画图是一件有趣的事情,并形成了一门被称为 ASCII Art 的艺术。例如,下图是用 ASCII 字符画出来的 CSPRO 字样。原创 2017-11-11 18:44:13 · 849 阅读 · 0 评论 -
CSUOJ 1726 你经历过绝望吗?两次!(BFS + 优先队列)
1726: 你经历过绝望吗?两次!Description4月16日,日本熊本地区强震后,受灾严重的阿苏市一养猪场倒塌,幸运的是,猪圈里很多头猪依然坚强存活。当地15名消防员耗时一天解救围困的“猪坚强”。不过与在废墟中靠吃木炭饮雨水存活36天的中国汶川“猪坚强”相比,熊本的猪可没那么幸运,因为它们最终还是没能逃过被送往屠宰场的命运。我们假设“猪坚强”被困在一个N*M的原创 2016-08-13 16:41:40 · 831 阅读 · 0 评论 -
HDOJ 1429 胜利大逃亡(续)(BFS + 状态压缩)
胜利大逃亡(续)Problem DescriptionIgnatius再次被魔王抓走了(搞不懂他咋这么讨魔王喜欢)……这次魔王汲取了上次的教训,把Ignatius关在一个n*m的地牢里,并在地牢的某些地方安装了带锁的门,钥匙藏在地牢另外的某些地方。刚开始Ignatius被关在(sx,sy)的位置,离开地牢的门在(ex,ey)的位置。Ignatius每分钟只能从一原创 2016-08-07 23:24:10 · 935 阅读 · 5 评论 -
HDOJ 1728 逃离迷宫(BFS + 记录拐弯次数)
逃离迷宫Problem Description 给定一个m × n (m行, n列)的迷宫,迷宫中有两个位置,gloria想从迷宫的一个位置走到另外一个位置,当然迷宫中有些地方是空地,gloria可以穿越,有些地方是障碍,她必须绕行,从迷宫的一个位置,只能走到与它相邻的4个位置中,当然在行走过程中,gloria不能走到迷宫外面去。令人头痛的是,gloria是个没什么方原创 2016-10-11 17:04:53 · 608 阅读 · 0 评论 -
POJ 2243 Knight Moves(BFS || 双向BFS)
Knight MovesDescriptionA friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits each square of a g原创 2016-08-03 23:11:23 · 335 阅读 · 0 评论 -
POJ 3321 Apple Tree(DFS + 树状数组)
Apple TreeDescriptionThere is an apple tree outside of kaka's house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefully nurturing the转载 2016-08-13 23:02:51 · 589 阅读 · 0 评论 -
HDOJ 1016 Prime Ring Problem(DFS)
Prime Ring ProblemProblem DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjace原创 2016-07-22 23:17:40 · 307 阅读 · 0 评论 -
HDOJ 2899 Strange fuction(二分 || 三分)
Strange fuctionProblem DescriptionNow, here is a fuction: F(x) = 6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 Can you find the minimum value when x is between 0 and 100. InputThe fi原创 2016-07-20 14:32:19 · 295 阅读 · 0 评论 -
HDOJ 2199 Can you solve this equation?(二分)
Can you solve this equation?Problem DescriptionNow,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100;Now please try your lucky.原创 2016-07-20 13:28:34 · 335 阅读 · 0 评论 -
CSUOJ 1224 ACM小组的古怪象棋(BFS)
1224: ACM小组的古怪象棋DescriptionACM小组的Samsara和Staginner对中国象棋特别感兴趣,尤其对马(可能是因为这个棋子的走法比较多吧)的使用进行深入研究。今天他们又在 构思一个古怪的棋局:假如Samsara只有一个马了,而Staginner又只剩下一个将,两个棋子都在棋盘的一边,马不能出这一半棋盘的范围,另外这 一半棋盘的大小很奇特(n行原创 2016-07-15 16:03:34 · 473 阅读 · 0 评论 -
CSUOJ 1511 残缺的棋盘(BFS)
1511: 残缺的棋盘DescriptionInput输入包含不超过10000 组数据。每组数据包含6个整数r1, c1, r2, c2, r3, c3 (1Output对于每组数据,输出测试点编号和最少步数。Sample Input1 1 8 7 5 61 1 3 3 2 2原创 2016-07-13 19:19:05 · 757 阅读 · 0 评论 -
CSUOJ 1010 Water Drinking(BFS)
1010: Water DrinkingDescriptionThe Happy Desert is full of sands. There is only a kind of animal called camel living on the Happy Desert. ‘Cause they live here, they need water here. Fortuna原创 2016-11-20 10:34:16 · 507 阅读 · 0 评论 -
CCF CSP 2016年04月第4题 游戏 (BFS)
问题描述试题编号:201604-4试题名称:游戏时间限制:1.0s内存限制:256.0MB问题描述:问题描述 小明在玩一个电脑游戏,游戏在一个n×m的方格图上进行,小明控制的角色开始的时候站在第一行第一列,目标是前往第n行第m列。 方格图上有一些方格是始终安全原创 2017-11-08 22:09:24 · 723 阅读 · 0 评论 -
CCF CSP 2014年9月第4题 最优配餐(多源多汇BFS)
问题描述试题编号:201409-4试题名称:最优配餐时间限制:1.0s内存限制:256.0MB问题描述:问题描述 栋栋最近开了一家餐饮连锁店,提供外卖服务。随着连锁店越来越多,怎么合理的给客户送餐成为了一个急需解决的问题。 栋栋的连锁店所在的区域可以看成是一个原创 2017-10-13 12:15:44 · 567 阅读 · 0 评论 -
LeetCode 399 Evaluate Division(BFS)
Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). Given some queries, return the answers. If the answ原创 2017-11-07 17:43:31 · 697 阅读 · 0 评论 -
LeetCode 515 Find Largest Value in Each Tree Row(二叉树层序遍历)
You need to find the largest value in each row of a binary tree.Example:Input: 1 / \ 3 2 / \ \ 5 3 9 Output: [1, 3, 9]题目大意:给出一棵二叉树,求出每一层的最原创 2017-07-18 19:44:42 · 332 阅读 · 0 评论 -
LeetCode 637 Average of Levels in Binary Tree(二叉树层序遍历)
Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array.Example 1:Input: 3 / \ 9 20 / \ 15 7Output: [3, 14.5, 11]Explanat原创 2017-07-21 19:05:21 · 1266 阅读 · 0 评论 -
LeetCode 111 Minimum Depth of Binary Tree(DFS)
Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.题目大意:给出一个二叉树,求从根节点到叶节点的最小深度。解题思路:直接D原创 2017-05-19 11:10:55 · 637 阅读 · 0 评论 -
LeetCode 104 Maximum Depth of Binary Tree(DFS)
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.题目大意:求二叉树的最大深度。解题思路:没啥好说的,直接DFS求解。原创 2017-05-19 10:49:13 · 795 阅读 · 0 评论 -
LeetCode 200 Number of Islands(DFS)
Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may as原创 2017-04-09 10:12:26 · 553 阅读 · 0 评论 -
POJ 1011 Sticks(DFS + 剪枝)
SticksDescriptionGeorge took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgo原创 2016-07-23 22:10:04 · 641 阅读 · 0 评论 -
HDOJ 1241 Oil Deposits(DFS)
Oil DepositsProblem DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land原创 2016-07-25 16:50:08 · 295 阅读 · 0 评论 -
CodeForces 702B Powers of Two(二分)
B. Powers of TwoYou are given n integers a1, a2, ..., an. Find the number of pairs of indexes i, j (i j) that ai + aj is a power of 2 (i. e. some integer xexists so that ai + aj =原创 2016-08-02 21:32:15 · 696 阅读 · 0 评论 -
SGU 114 Telecasting station(二分)
114. Telecasting stationEvery city in Berland is situated on Ox axis. The government of the country decided to build new telecasting station. After many experiments Berland scientists came原创 2016-08-06 21:48:07 · 427 阅读 · 0 评论 -
HDOJ 1240 Asteroids!(三维BFS)
Asteroids!Problem DescriptionYou're in space.You want to get home.There are asteroids.You don't want to hit them. InputInput to this problem will consist of a (non-原创 2016-08-06 22:20:56 · 504 阅读 · 0 评论 -
HDOJ 1253 胜利大逃亡(三维BFS)
胜利大逃亡Problem DescriptionIgnatius被魔王抓走了,有一天魔王出差去了,这可是Ignatius逃亡的好机会.魔王住在一个城堡里,城堡是一个A*B*C的立方体,可以被表示成A个B*C的矩阵,刚开始Ignatius被关在(0,0,0)的位置,离开城堡的门在(A-1,B-1,C-1)的位置,现在知道魔王将在T分钟后回到城堡,Ignatius每原创 2016-08-07 21:48:17 · 288 阅读 · 0 评论 -
POJ 1724 ROADS(BFS + 优先队列)
ROADSDescriptionN cities named with numbers 1 ... N are connected with one-way roads. Each road has two parameters associated with it : the road length and the toll that needs to be paid f原创 2016-08-17 23:46:33 · 418 阅读 · 0 评论 -
HDOJ 1072 Nightmare(BFS)
NightmareProblem DescriptionIgnatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrinth has an exit, Ignatius should get out of the labyri原创 2016-08-16 16:51:31 · 354 阅读 · 0 评论 -
POJ 2531 Network Saboteur(DFS)
Network SaboteurDescriptionA university network is composed of N computers. System administrators gathered information on the traffic between nodes, and carefully divided the network into原创 2016-07-23 21:05:33 · 280 阅读 · 0 评论 -
POJ 3737 UmBasketella(三分)
UmBasketellaDescriptionIn recent days, people always design new things with multifunction. For instance, you can not only use cell phone to call your friends, but you can also use your cel原创 2016-07-24 21:25:23 · 420 阅读 · 0 评论 -
HDOJ 4198 Quick out of the Harbour(BFS)
Quick out of the HarbourProblem DescriptionCaptain Clearbeard decided to go to the harbour for a few days so his crew could inspect and repair the ship. Now, a few days later, the pirates原创 2016-08-02 21:21:15 · 365 阅读 · 0 评论 -
POJ 1905 Expanding Rods(二分)
Expanding RodsDescriptionWhen a thin rod of length L is heated n degrees, it expands to a new length L'=(1+n*C)*L, where C is the coefficient of heat expansion. When a thin rod is mounte原创 2016-08-01 19:47:19 · 339 阅读 · 0 评论 -
POJ 1548 A strange lift(BFS)
A strange liftProblem DescriptionThere is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every floor.The lift have just two bu原创 2016-07-30 22:27:18 · 287 阅读 · 0 评论 -
POJ 3620 Avoid The Lakes(DFS)
Avoid The LakesDescriptionFarmer John's farm was flooded in the most recent storm, a fact only aggravated by the information that his cows are deathly afraid of water. His insurance agency原创 2016-07-24 08:57:40 · 347 阅读 · 0 评论 -
POJ 1979 Red and Black(DFS)
Red and BlackDescriptionThere 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原创 2016-07-25 17:05:40 · 261 阅读 · 0 评论 -
HDOJ 1969 Pie(二分)
PieProblem DescriptionMy 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 a原创 2016-07-20 18:44:37 · 509 阅读 · 0 评论 -
POJ 1915 Knight Moves(BFS)
Knight MovesDescriptionBackground Mr Somurolov, fabulous chess-gamer indeed, asserts that no one else but him can move knights from one position to another so fast. Can you beat him? T原创 2016-07-15 16:33:40 · 270 阅读 · 0 评论 -
HDOJ 5025 Saving Tang Monk(BFS + 优先队列 + 状态压缩)
Saving Tang MonkProblem Description《Journey to the West》(also 《Monkey》) is one of the Four Great Classical Novels of Chinese literature. It was written by Wu Cheng'en during the Ming Dyn原创 2016-08-04 21:16:30 · 580 阅读 · 0 评论 -
HDOJ 1242 Rescue(BFS + 优先队列)
RescueProblem DescriptionAngel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M Angel's friends want to save Angel. Their task is:原创 2016-07-26 22:08:17 · 508 阅读 · 0 评论 -
POJ 3278 Catch That Cow(BFS)
Catch That CowDescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and t原创 2016-07-27 08:44:05 · 265 阅读 · 0 评论