vj题
hu的小金库
正在编程路上走
展开
-
Fire Game(BFS的应用)
Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of this board is consisting of grass or just empty and then they start...原创 2018-08-31 08:49:40 · 86 阅读 · 0 评论 -
Fire! (BFS,交替的BFS)
https://cn.vjudge.net/problem/UVA-11624 这其实是一个很水的题!!但我为啥能卡这么久呢!!! 忽略了题目一个问题!F的位置有多个!!! 解题的大致思路:因为他是交替进行的,于是就能用z标记一下, 然后分别标记一起进行BFS。 #include <iostream> #include <cstdio> #include <...原创 2018-09-16 22:02:18 · 175 阅读 · 0 评论 -
Preparing for Exams(割线定理)
https://cn.vjudge.net/contest/251958#problem/G 割线定理(Secant Theorem)指的是从圆外一点引圆的两条割线,这一点到每条割线与圆交点的距离的积相等。 文字表达:从圆外一点引圆的两条割线,这一点到每条割线与圆交点的距离的积相等。 数学语言:从圆外一点L引两条割线与圆分别交于A.B.C.D 则有 LA·LB=LC·LD=LT²。 几何语...原创 2018-09-05 11:16:17 · 600 阅读 · 0 评论 -
蜘蛛牌 (DFS应用)
https://cn.vjudge.net/problem/HDU-1584 并不太理解其中原理。。。 蜘蛛牌是windows xp操作系统自带的一款纸牌游戏,游戏规则是这样的:只能将牌拖到比她大一的牌上面(A最小,K最大),如果拖动的牌上有按顺序排好的牌时,那么这些牌也跟着一起移动,游戏的目的是将所有的牌按同一花色从小到大排好,为了简单起见,我们的游戏只有同一花色的10张牌,从A到10,且随...原创 2018-09-04 16:49:05 · 200 阅读 · 0 评论 -
Dungeon Master--(三维的BFS)
You 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 rock. It takes one minute to move one unit north, south...原创 2018-08-29 19:49:43 · 235 阅读 · 0 评论 -
素数回文(小技巧)
https://cn.vjudge.net/problem/HDU-1431 xiaoou33对既是素数又是回文的数特别感兴趣。比如说151既是素数又是个回文。现在xiaoou333想要你帮助他找出某个范围内的素数回文数,请你写个程序找出 a 跟b 之间满足条件的数。(5 <= a < b <= 100,000,000); Input 这里有许多组数据,每组包括两组数据a...原创 2018-09-04 08:59:05 · 301 阅读 · 0 评论 -
G - 棋盘问题(DFS深搜)
G - 棋盘问题 https://cn.vjudge.net/contest/242367#problem/G 这个题留下了深深的教训。。。 一周前看的这个题,以为自己搞懂了,,然后还写了CSDN,结果还写的一个错的,这次测试狠狠地被打了耳光。。。 自己是真的菜啊。。 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者...原创 2018-08-24 22:49:18 · 176 阅读 · 0 评论 -
Longest k-Good Segment (尺取法)
The array a with n integers is given. Let's call the sequence of one or more consecutive elements in a segment. Also let's call the segment k-good if it contains no more than k different values. F...原创 2018-08-28 20:29:05 · 487 阅读 · 0 评论 -
Eyad and Math(换底公式)
https://cn.vjudge.net/problem/Gym-101502H Eyad was given a simple math problem, but since he is very bad at math he asked you to help him. Given 4 numbers, a, b, c, and d. Your task is to find wheth...原创 2018-08-30 23:55:18 · 380 阅读 · 0 评论 -
非常可乐(两种解法:数论或BFS)
大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S<101)毫升 (正好装满一瓶) ,它们三个之间可以相互倒可乐 (都是没有刻度的,且 S==N+M,101>S>...原创 2020-08-01 23:13:17 · 129 阅读 · 0 评论