
搜索
文章平均质量分 80
YOONGI
这个作者很懒,什么都没留下…
展开
-
水陆距离 HihoCoder - 1478
水陆距离 HihoCoder - 1478给定一个N x M的01矩阵,其中1表示陆地,0表示水域。对于每一个位置,求出它距离最近的水域的距离是多少。 矩阵中每个位置与它上下左右相邻的格子距离为1。Input第一行包含两个整数,N和M。以下N行每行M个0或者1,代表地图。数据保证至少有1块水域。对于30%的数据,1 <= N, M <= 100 对于100%的数据,1 <=...原创 2018-04-11 19:51:58 · 199 阅读 · 0 评论 -
HDU - 1584 蜘蛛牌 (深搜)
蜘蛛牌蜘蛛牌是windows xp操作系统自带的一款纸牌游戏,游戏规则是这样的:只能将牌拖到比她大一的牌上面(A最小,K最大),如果拖动的牌上有按顺序排好的牌时,那么这些牌也跟着一起移动,游戏的目的是将所有的牌按同一花色从小到大排好,为了简单起见,我们的游戏只有同一花色的10张牌,从A到10,且随机的在一行上展开,编号从1到10,把第i号上的牌移到第j号牌上,移动距离为abs(i-j),现在你...原创 2019-03-27 20:51:27 · 136 阅读 · 0 评论 -
POJ - 3026 Borg Maze (BFS + 最小生成树)
Borg MazeThe Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collective is the term used to describe the group consciousness of the Borg civi...原创 2019-03-28 15:24:15 · 120 阅读 · 0 评论 -
CodeForces - 813C The Tag Game (BFS)
The Tag Game 题目链接:http://codeforces.com/problemset/problem/813/CAlice got tired of playing the tag game by the usual rules so she offered Bob a little modification to it. Now the game should be ...原创 2019-04-08 13:01:58 · 210 阅读 · 0 评论 -
POJ - 3279 Fliptile (状压+暴力)
FliptileFarmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He has arranged a brainy activity for cows in which they manipulate anM×Ngrid (1 ≤M≤ 15; 1...原创 2019-05-17 15:47:54 · 198 阅读 · 0 评论 -
POJ - 3414 Pots (BFS +记录路径)
PotsYou are given two pots, having the volume ofAandBliters respectively. The following operations can be performed:FILL(i) fill the poti(1 ≤i≤ 2) from the tap; DROP(i) empty ...原创 2019-05-17 16:50:11 · 127 阅读 · 0 评论 -
HDU - 1043 Eight (BFS+康托展开+记录路径)
EightThe 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it, and all...原创 2019-05-23 20:03:38 · 184 阅读 · 0 评论 -
HDU - 2102 A计划 (BFS 三维图搜索)
A计划可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而今,不幸的她再一次面临生命的考验。魔王已经发出消息说将在T时刻吃掉公主,因为他听信谣言说吃公主的肉也能长生不老。年迈的国王正是心急如焚,告招天下勇士来拯救公主。不过公主早已习以为常,她深信智勇的骑士LJ肯定能将她救出。现据密探所报,公主被关在一个两层的迷宫里,迷宫的入口是S(0,0,0),公主的位置用P表示,时空传输机用#表示,...原创 2019-05-23 20:15:07 · 144 阅读 · 0 评论 -
HDU - 2181 哈密顿绕行世界问题 (DFS)
哈密顿绕行世界问题一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。Input前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个数m,m<=20,m>=1.m=0退出.Output输出从第m个城市出发经过每个城市1次又回到m的所有路线,如有多条路线,按字典序输出,...原创 2019-05-24 09:10:03 · 97 阅读 · 0 评论 -
CodeForces - 682C Alyona and the Tree (DFS)
Alyona and the TreeAlyona decided to go on a diet and went to the forest to get some apples. There she unexpectedly found a magic rooted tree with root in the vertex1, every vertex and every edg...原创 2019-07-30 15:26:23 · 269 阅读 · 0 评论 -
CodeForces - 350B Resort (DFS)
ResortValera's finally decided to go on holiday! He packed up and headed for a ski resort.Valera's fancied a ski trip but he soon realized that he could get lost in this new place. Somebody gav...原创 2019-08-03 08:59:55 · 256 阅读 · 0 评论 -
CodeForces - 721C Journey (DFS + DP + 记录路径)
JourneyRecently Irina arrived to one of the most famous cities of Berland— the Berlatov city. There arenshowplaces in the city, numbered from1ton, and some of them are connected by one-dire...原创 2019-08-03 16:09:50 · 494 阅读 · 0 评论 -
CodeForces - 585B Phillip and Trains (思维+ BFS)
Phillip and TrainsThe mobile application store has a new game called "Subway Roller".The protagonist of the game Philip is located in one end of the tunnel and wants to get out of the other one...原创 2019-07-31 09:15:36 · 331 阅读 · 0 评论 -
ZOJ - 3736 Pocket Cube (模拟暴搜)
Pocket CubePocket Cube is a 3-D combination puzzle. It is a 2 × 2 × 2 cube, which means it is constructed by 8 mini-cubes. For a combination of 2 × 2 mini-cubes which sharing a whole cube face, y...原创 2019-08-02 09:43:30 · 187 阅读 · 0 评论 -
小明系列故事——捉迷藏(BFS)
小明系列故事——捉迷藏小明的妈妈生了三个孩子,老大叫大明, 老二叫二明, 老三..., 老三自然就叫小明了。 一天,小明的妈妈带小明兄弟三人去公园玩耍,公园里面树木很多,有很多地方可以藏身, 于是他们决定玩捉迷藏。经过几轮的猜拳后,第一轮是小明来找其他两个人,游戏规则很简单: 只要小明可以在规定的时间内找到他们就算小明获胜,并且被发现的两个人猜拳决定谁在下一轮负责找人;如果在规定的时间内只找...原创 2018-03-23 19:09:42 · 20514 阅读 · 0 评论 -
Prime Path
Prime PathThe ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It is原创 2018-01-08 09:55:06 · 154 阅读 · 0 评论 -
Find The Multiple
Find The MultipleGiven a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not great原创 2018-01-08 09:42:40 · 231 阅读 · 0 评论 -
NYOJ zb的生日
zb的生日题目描述今天是阴历七月初五,acm队员zb的生日。zb正在和C小加、never在武汉集训。他想给这两位兄弟买点什么庆祝生日,经过调查,zb发现C小加和never都很喜欢吃西瓜,而且一吃就是一堆的那种,zb立刻下定决心买了一堆西瓜。当他准备把西瓜送给C小加和never的时候,遇到了一个难题,never和C小加不在一块住,只能把西瓜分成两堆给他们,为了对每个人都公平,他想原创 2017-12-04 21:15:04 · 216 阅读 · 0 评论 -
NYOJ 部分和问题(入门题)
部分和问题(入门题)题目描述给你n个数(a1,a2,a3.......an) ,是否存在某一些数字加起来等于k,有就输出 "YES",否则输出 "NO"。数据范围:na1+a2+....an在int范围里面.输入多组输入每组第一行输入两个数n,k第二行输入n个数a1 a2 ...... an输出如果存在一些数加起来为k输出"YES原创 2017-11-30 19:49:47 · 502 阅读 · 0 评论 -
NYOJ 部分和问题
部分和问题题目描述给定整数a1、a2、.......an,判断是否可以从中选出若干数,使它们的和恰好为K。输入首先,n和k,n表示数的个数,k表示数的和。接着一行n个数。(1输出如果和恰好可以为k,输出“YES”,并按输入顺序依次输出是由哪几个数的和组成,否则“NO”样例输入复制4 131 2 4 7原创 2017-11-30 19:58:27 · 333 阅读 · 0 评论 -
NYOJ 组合数
组合数题目描述找出从自然数1、2、... 、n(0输入输入n、r。输出按特定顺序输出所有组合。特定顺序:每一个组合中的值从大到小排列,组合之间按逆字典序排列。样例输入复制5 3样例输出复制543542541532531521432431421321提示原创 2017-12-05 11:37:41 · 180 阅读 · 0 评论 -
坦克大战
坦克大战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原创 2017-12-22 15:14:26 · 345 阅读 · 0 评论 -
NYOJ 最少步数
最少步数题目描述这有一个迷宫,有0~8行和0~8列: 1,1,1,1,1,1,1,1,1 1,0,0,1,0,0,1,0,1 1,0,0,1,1,0,0,0,1 1,0,1,0,1,1,0,1,1 1,0,0,0,0,1,0,0,1 1,1,0,1,0,1,0,0,1 1,1,0,1,0,1,0,0,1 1,1,0,1,0,0,0,0,1 1,1,1,1,1,1,原创 2017-12-06 20:24:29 · 207 阅读 · 0 评论 -
NYOJ 素数环
素数环题目描述有一个整数n,把从1到n的数字无重复的排列成环,且使每相邻两个数(包括首尾)的和都为素数,称为素数环。为了简便起见,我们规定每个素数环都从1开始。例如,下图就是6的一个素数环。输入有多组测试数据,每组输入一个n(0输出每组第一行输出对应的Case序号,从1开始。如果存在满足题意叙述的素数环,从小到大输出。否则输出No Answe原创 2017-12-06 21:18:08 · 590 阅读 · 0 评论 -
最少步数
最少步数这有一个迷宫,有0~8行和0~8列: 1,1,1,1,1,1,1,1,1 1,0,0,1,0,0,1,0,1 1,0,0,1,1,0,0,0,1 1,0,1,0,1,1,0,1,1 1,0,0,0,0,1,0,0,1 1,1,0,1,0,1,0,0,1 1,1,0,1,0,1,0,0,1 1,1,0,1,0,0,0,0,1 1,1,1,1,1原创 2017-12-15 16:33:33 · 329 阅读 · 0 评论 -
NYOJ 最大岛屿
最大岛屿题目描述神秘的海洋,惊险的探险之路,打捞海底宝藏,激烈的海战,海盗劫富等等。加勒比海盗,你知道吧?杰克船长驾驶着自己的的战船黑珍珠1号要征服各个海岛的海盜,最后成为海盗王。 这是一个由海洋、岛屿和海盗组成的危险世界。面对危险重重的海洋与诡谲的对手,如何凭借智慧与运气,建立起一个强大的海盗帝国。杰克船长手头有一张整个海域的海图,上面密密麻麻分布着各个海屿的位置及面积。他想尽原创 2017-12-07 19:28:14 · 273 阅读 · 0 评论 -
Oil Deposits
Oil Deposits The 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原创 2017-12-07 20:16:22 · 153 阅读 · 0 评论 -
NYOJ 棋盘问题
棋盘问题 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n原创 2017-12-29 20:41:46 · 3457 阅读 · 0 评论 -
Dungeon Master
Dungeon MasterYou are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with...原创 2017-12-29 20:55:50 · 279 阅读 · 0 评论 -
Catch That Cow
Catch That CowFarmer 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 the cow is at a poin原创 2017-12-30 10:37:41 · 195 阅读 · 0 评论 -
NYOJ 数独
数独描述 数独是一种运用纸、笔进行演算的逻辑游戏。玩家需要根据9×9盘面上的已知数字,推理出所有剩余空格的数字,并满足每一行、每一列、每一个3*3宫内的数字均含1-9,不重复。 每一道合格的数独谜题都有且仅有唯一答案,推理方法也以此为基础,任何无解或多解的题目都是不合格的。 有一天hrdv碰到了一道号称是世界上最难的数独的题目,作为一名合原创 2017-12-30 11:26:08 · 263 阅读 · 0 评论 -
CodeForces - 598D Igor In the Museum (广搜)
Igor In the MuseumIgor is in the museum and he wants to see as many pictures as possible.Museum can be represented as a rectangular field ofn × mcells. Each cell is either empty or impassable...原创 2019-08-02 11:40:01 · 158 阅读 · 0 评论