搜索
brav0
练习算法两年半的ACM选手
展开
-
“科大讯飞杯”第十七届同济大学程序设计预选赛暨高校网络友谊赛 D车辆调度
链接:https://ac.nowcoder.com/acm/contest/5477/D来源:牛客网张老师设计了一个智能调度系统来控制他的遥控车队,今天,他带着他的车队来到黄渡理工大学的一块空地上测试这个系统。这块空地可以描述为一个 w * h 大小的长方形,广场上有一些障碍物,几个目标点,当然,还有张老师的车队。每分钟,调度系统会智能地向其中的一辆遥控车发送以下指令的其中一条: 向北走,直到撞到空地的边界、障碍物或其他遥控车; 向南走,直到撞到空地的边界、障碍物或其他遥控车.原创 2020-05-11 00:25:35 · 240 阅读 · 0 评论 -
HDU 1240 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-empty) series of up to 100 data sets. ...原创 2019-02-12 15:56:08 · 763 阅读 · 2 评论 -
HDU 1258 Sum It Up (搜索)
链接http://acm.hdu.edu.cn/diy/contest_showproblem.php?pid=1004&cid=34750Problem DescriptionGiven a specified total t and a list of n integers, find all distinct sums using numbers from the list ...原创 2019-02-11 21:16:58 · 275 阅读 · 0 评论 -
HDU 1548 A strange lift (搜索)
链接http://acm.hdu.edu.cn/diy/contest_showproblem.php?pid=1019&cid=34750Problem DescriptionThere is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 &l...原创 2019-02-10 11:44:32 · 264 阅读 · 0 评论 -
HDU 1010 Tempter of the Bone (搜索)
链接http://acm.hdu.edu.cn/diy/contest_showproblem.php?pid=1012&cid=34750Problem DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, ...原创 2019-02-09 21:02:10 · 284 阅读 · 0 评论 -
HDU 1016 Prime Ring Problem (搜索)
Problem 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 adjacent circles should be a prime....原创 2019-02-09 18:28:29 · 243 阅读 · 1 评论 -
HDU 1716 排列2(DFS)
链接http://acm.hdu.edu.cn/showproblem.php?pid=1716Problem DescriptionRay又对数字的列产生了兴趣:现有四张卡片,用这四张卡片能排列出很多不同的4位数,要求按从小到大的顺序输出这些4位数。Input每组数据占一行,代表四张卡片上的数字(0<=数字<=9),如果四张卡片都是0,则输入结束。Output...原创 2019-02-09 18:18:13 · 454 阅读 · 0 评论 -
HDU 2952 Counting Sheep (搜索)
链接http://acm.hdu.edu.cn/showproblem.php?pid=2952Problem DescriptionA while ago I had trouble sleeping. I used to lie awake, staring at the ceiling, for hours and hours. Then one day my grandmother...原创 2019-02-09 18:12:54 · 405 阅读 · 0 评论 -
HDU 1518 Square (搜索)
链接http://acm.hdu.edu.cn/showproblem.php?pid=1518Problem DescriptionGiven a set of sticks of various lengths, is it possible to join them end-to-end to form a square?InputThe first line of inpu...原创 2019-02-09 17:14:38 · 291 阅读 · 0 评论 -
HDU 2533 N皇后问题 (搜索)
链接http://acm.hdu.edu.cn/showproblem.php?pid=2553Problem Description在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。你的任务是,对于给定的N,求出有多少种合法的放置方法。Input共有若干行,每行一个正整数N≤10,表示...原创 2019-02-09 17:05:54 · 256 阅读 · 0 评论 -
HDU 1312 Red and Black (搜索)
链接http://acm.hdu.edu.cn/showproblem.php?pid=1312Problem DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black ti...原创 2019-02-09 16:49:44 · 187 阅读 · 0 评论 -
HDU 1181 变形课 (搜索)
链接http://acm.hdu.edu.cn/showproblem.php?pid=1181Problem Description呃......变形课上Harry碰到了一点小麻烦,因为他并不像Hermione那样能够记住所有的咒语而随意的将一个棒球变成刺猬什么的,但是他发现了变形咒语的一个统一规律:如果咒语是以a开头b结尾的一个单词,那么它的作用就恰好是使A物体变成B物体.Harry...原创 2019-02-09 12:27:47 · 252 阅读 · 0 评论 -
ZZULIOJ 1149: 组合三位数之二
题目描述把1,2,3,4,5,6,7,8,9,组成三个三位数(每个数只能用一次),第二个数是第一个数的2倍,第三个数是第一个数的3倍,这三个三位数各是多少?答案可能有很多组,请按第一个数的升序顺序输出每组的三个三位数。输入无输出输出所有满足条件的三位数组合,按第一个数的升序顺序输出。样例输出192 384 576219 438 657…#include&amp;amp;lt;stdio.h&amp;amp;gt...原创 2018-12-08 13:44:12 · 1132 阅读 · 0 评论 -
2019牛客暑期多校训练营(第九场)D:Knapsack Cryptosystem(折半搜索)
链接:https://ac.nowcoder.com/acm/contest/889/D时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述Amy asks Mr. B problem D. Please help Mr. B to solve the following probl...原创 2019-08-16 12:10:48 · 226 阅读 · 0 评论 -
ZZULIOJ 1219: 速算24点
时间限制: 1 Sec内存限制: 128 MB提交: 155解决: 34[提交] [状态] [讨论版] [命题人:外部导入]题目描述速算24点相信绝大多数人都玩过。就是随机给你四张牌,包括 A(1),2,3,4,5,6,7,8,9,10,J(11),Q(12),K(13)。要求只用'+','-','*','/'运算符以及括号改变运算 顺序,使得最终运算结果为24(每个数必须且仅...原创 2019-05-11 23:33:51 · 1767 阅读 · 4 评论 -
蓝桥杯 Degrees of Separation (BFS)
问题描述 在我们联系日益紧密的世界里,人们推测每个人和其他人的分离度不超过六(六度分离)。在这个问题里,你需要写一个程序来找出人们的关系网络中最大的分离度。 对于任意两个人,他们的分离度是联系两个人需要经过的最小的关系数。对于一个关系网络,最大的分离度是网络中任意两人的分离度的最大值。如果一个网络中有两个人没有通过关系链连接起来,这个网络是不连通的。 如下图所示,一个网络可以用一些连...原创 2019-05-14 23:55:47 · 624 阅读 · 0 评论 -
蓝桥杯 金陵十三钗 (状压dp or DFS剪枝)
算法提高 金陵十三钗 时间限制:1.0s 内存限制:256.0MB 金陵十三钗 本题难度:难 本题占分比例:5%问题描述 在电影《金陵十三钗》中有十二个秦淮河的女人要自我牺牲代替十二个女学生去赴日本人的死亡宴会。为了不让日本人发现,自然需要一番乔装打扮。但由于天生材质的原因,每个人和每个人之间的相似度是不同的。由于我们这是编程题,因此情况就变成了金陵...原创 2019-05-19 10:51:28 · 426 阅读 · 0 评论 -
2019 CCPC 河南省赛 I :Childhood dream(枚举)
题目描述你童年时期就有一个梦想,想要加入 ACM(Association of Calculation and Magic),今天,这个机会终于 来了。但是 ACM 只想要哪些天赋异禀的人, 比如像 tourist,他们给了你一道题来检测你是否足够机智。猜一个长度为 m 数字串,总共有 n 个提示串,解释如下:8640 0A2BA 前面的数字说明与答案相比,有多少个位置上的数字...原创 2019-04-14 23:00:14 · 508 阅读 · 0 评论 -
ZZULIOJ 2267: scholarship
题目描述 小浩今年拿到了国家奖学金,本来很高兴的事,可小浩却默默不乐,原来是不愿请大家吃饭,小浩查了一下银行卡,一看还有8位数,于是嘴角向上微翘,冷笑一声,说想让我请客,先能回答出我的问题来。小浩的问题是给定一个8位的正整数,如果能判断出这8位数是否能组成一个日期的年月日(年份范围0000~9999),就可以请客,同学们还等什么,加油啦!输入输入有多行,每行一个8位的正整数。输出 对于输...原创 2019-01-20 13:01:06 · 167 阅读 · 0 评论 -
HDU 2612 Find a way(搜索)
Problem DescriptionPass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to meet. Especially a good friend Merceki.Yifenfei...原创 2019-02-14 20:46:08 · 124 阅读 · 0 评论 -
HDU 1241 Oil Deposits (搜索)
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-02-13 22:52:22 · 178 阅读 · 0 评论 -
HDU 1242 Rescue(搜索)
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.Ang...原创 2019-02-13 22:25:45 · 225 阅读 · 0 评论 -
HDU 1045 Fire Net (搜索)
Problem DescriptionSuppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street or a piece of wall.A blockhouse ...原创 2019-02-13 22:05:48 · 191 阅读 · 0 评论 -
HDU 1372 Knight Moves (搜索)
Problem DescriptionA 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 given set of n ...原创 2019-02-13 21:57:31 · 195 阅读 · 0 评论 -
HDU 1015 Safecracker (搜索)
Problem Description=== Op tech briefing, 2002/11/02 06:42 CST ==="The item is locked in a Klein safe behind a painting in the second-floor library. Klein safes are extremely rare; most of them, alo...原创 2019-02-12 16:16:48 · 210 阅读 · 0 评论 -
HDU 1253 胜利大逃亡 (搜索)
Problem DescriptionIgnatius被魔王抓走了,有一天魔王出差去了,这可是Ignatius逃亡的好机会.魔王住在一个城堡里,城堡是一个A*B*C的立方体,可以被表示成A个B*C的矩阵,刚开始Ignatius被关在(0,0,0)的位置,离开城堡的门在(A-1,B-1,C-1)的位置,现在知道魔王将在T分钟后回到城堡,Ignatius每分钟能从一个坐标走到相邻的六个坐标中的其...原创 2019-02-12 16:03:41 · 336 阅读 · 2 评论 -
nyoj 547- Interesting Punch-Bowl(优先队列模拟)
题目描述:Dr.Konghas taken a side job designing interesting punch-bowl designs. The designs are created as follows: * A flat board of size W cm * H cm is procured (3 <= W <= 300,...原创 2019-05-02 20:11:09 · 297 阅读 · 0 评论 -
nyoj 543-遥 控 器(bfs)
题目描述:Dr.Kong有一台高级电视机,这台电视机可以接受100个频道(从0到99编号)。电视的配套遥控器有13个按钮:1 2 3 ↑4 5 6 ↓7 8 9— 0当按"↑"键时,当前频道编号会增加1(如果当前为99频道,则会切换到0频道)。如果按"↓"键,当前频道编号会减小1(如果当前为0频道,则会切换到99频道)。当要切换到0~9频道...原创 2019-05-02 20:36:30 · 146 阅读 · 0 评论 -
ZZULIOJ 1726: 迷宫 (bfs)
时间限制: 1 Sec内存限制: 128 MB提交: 1067解决: 164[提交] [状态] [讨论版] [命题人:admin]题目描述在很多 RPG (Role-playing Games) 游戏中,迷宫往往是非常复杂的游戏环节。通常来说,我们在走迷宫的时候都需要花非常多的时间来尝试不同的路径。但如果有了算法和计算机的帮助,我们能不能有更快的方式来解决这个问题?我们可以进行...原创 2019-04-29 12:49:11 · 207 阅读 · 0 评论 -
nyoj 10-skiing (记忆化搜索)
题目描述:Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子1 2 3 4 516 17 18 19 615 24 25 20 714 23 22 21 813 12 1...原创 2019-05-05 09:24:16 · 186 阅读 · 0 评论 -
ZZULIOJ 1458: 走迷宫(二分,dfs)
题目描述Dr.Kong设计的机器人卡多非常爱玩,它常常偷偷跑出实验室,在某个游乐场玩之不疲。这天卡多又跑出来了,在SJTL游乐场玩个不停,坐完碰碰车,又玩滑滑梯,这时卡多又走入一个迷宫。整个迷宫是用一个N*N的方阵给出,方阵中单元格中填充了一个整数,表示走到这个位置的难度。这个迷宫可以向上走,向下走,向右走,向左走,但是不能穿越对角线。走迷宫的取胜规则很有意思,看谁能更快地找到一条路径...原创 2019-04-25 19:20:30 · 250 阅读 · 2 评论