重新学编程之简单搜索
ZZ --瑞 hopeACMer
WA就完事了
展开
-
K - 【粉色】浣熊市下水道 (Gym - 102072K )(bfs)
在浣熊市狭窄的下水道中,伴随着枪响,那颗本应射中艾达的子弹被浣熊市新晋警察里昂挡了下来。艾达无法理解里昂为什么会为她挡下这发子弹,但她还是将里昂拖到了安全的地方并用绷带治疗了里昂。由于任务在身,艾达不得已丢下了昏迷的里昂,继续去追击G病毒的创造者。当里昂逐渐恢复意识,他发现自己已经是弹尽粮绝,尽管下水道中拥有大量的感染者,但他还是想追上艾达。已知浣熊市下水道的平面图可以简化为一个nn行mm列的矩阵...原创 2019-07-02 20:48:06 · 233 阅读 · 0 评论 -
K - Birthday Puzzle Gym - 102267K (dfs)
K - Birthday PuzzleGym - 102267KToday is the Birthday of a beautiful girl, she's happy and she's telling her friends loudly to bring her birthday gifts. One of her best friends who is fond of pu...原创 2019-07-26 14:49:03 · 207 阅读 · 0 评论 -
J - Fire! UVA - 11624 (多起点BFS+两次BFS)
Joe works in a maze. Unfortunately, portions of the maze havecaught on fire, and the owner of the maze neglected to create a fireescape plan. Help Joe escape the maze.Given Joe’s location in the ma...原创 2019-07-26 19:12:48 · 133 阅读 · 0 评论 -
G - Shuffle'm Up POJ - 3087(string+BFS模拟题意)
G - Shuffle'm Up POJ - 3087(string+BFS模拟题意)A common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker chips,...原创 2019-07-26 20:06:54 · 109 阅读 · 0 评论 -
C - Fliptile (黑白棋翻转经典题型 DFS)
C - 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...原创 2019-07-26 20:13:50 · 1441 阅读 · 0 评论 -
H - Islands Gym - 101291H (bfs)
Download此题bfs搜索数量#include <iostream>#include <string.h>#include <stdio.h>#include <queue>#include <bits/stdc++.h>using namespace std;struct node{int x,y;};...原创 2019-07-23 15:03:00 · 147 阅读 · 0 评论 -
I - I Will Go Gym - 101875I (dfs序)
GEMA is hostingQrounds of 10-hour-long contests in honor of the great Danfto. Everybody wants to honor Danfto, but 10 hours is a really long time, so people are wondering whether to go or not.A pe...原创 2019-08-05 19:48:04 · 177 阅读 · 0 评论 -
H - Safe Path Gym - 101755H (bfs+)
You play a new RPG. The world map in it is represented by a grid ofn × mcells. Any playing character staying in some cell can move from this cell in four directions— to the cells to the left, right...原创 2019-08-06 14:11:15 · 150 阅读 · 0 评论 -
Gym 101490C Brexit(搜索)
https://vjudge.net/contest/186932#problem/C给定一个图。表示一个王国,给你s,代表你的家乡。t,代表最开始分裂的城市,如果一个城市,和他邻接的一半城市都分裂了,那么他也要分裂。问你能否使你的家乡分裂。我感觉,dfs我是不太擅长的qwq。直接广搜也是阔以的。存一下度数,然后邻接的都减一下度数。就酱紫代码://Full of love...原创 2019-08-20 14:35:17 · 151 阅读 · 0 评论 -
F - Spanning Tree with Maximum Degree CodeForces - 1133F1 (bfs)
You are given an undirected unweighted connected graph consisting ofnnvertices andmmedges. It is guaranteed that there are no self-loops or multiple edges in the given graph.Your task is to find...原创 2019-08-16 17:01:42 · 152 阅读 · 0 评论 -
D - Robots Easy Gym - 102267D (bfs+记录)
D - Robots EasyGym - 102267DAlice was playing her favorite game, "Tales of the Abyss", while playing she encountered the following puzzle that can be described as a12×1212×12grid:A robot i...原创 2019-07-26 14:46:24 · 445 阅读 · 0 评论 -
F - Pots POJ - 3414
You 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 the po...原创 2019-07-22 17:30:03 · 130 阅读 · 0 评论 -
K - Assigning Frequencies (dfs暴力枚举)
题意是:,往这个图中的点放置频率,总共有三种频率,如果这两个点连通,并且频率一样,则与题目不符,反之任意两个连通的点频率都要不一样;思路:dfs暴力枚举,类似于棋盘问题,用flag存频率种类,从0遍历到最后一个点看是否符合题意(注意只有三种频率)代码://Full of love and hope for the life//https://paste.ubuntu.com/...原创 2019-07-31 13:59:59 · 206 阅读 · 0 评论 -
C - Catch That Cow POJ - 3278 (bfs)
C - Catch That CowPOJ - 3278Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a pointN(0 ≤N≤ 100,000) on a number line and the ...原创 2019-07-24 09:10:32 · 156 阅读 · 0 评论 -
B - Dungeon Master POJ - 2251 (bfs三维空间)
B - Dungeon MasterPOJ - 2251You 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 mi...原创 2019-07-24 09:10:25 · 113 阅读 · 0 评论 -
D - Find The Multiple (bfs)
D - 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 ...原创 2019-07-24 16:27:20 · 123 阅读 · 0 评论 -
E - Prime Path (bfs+找素数)
E - 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.— I...原创 2019-07-24 19:54:26 · 105 阅读 · 0 评论 -
G - Find a way (bfs)
G - Find a wayPass 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-07-24 20:35:03 · 152 阅读 · 0 评论 -
I - 迷宫问题 (bfs+dfs查路径)
I - 迷宫问题定义一个二维数组:int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。...原创 2019-07-25 10:10:06 · 193 阅读 · 0 评论 -
K - 非常可乐 (bfs)
K - 非常可乐大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S<101)毫升 (正好装满一瓶) ,它们三个之间可以相互倒可乐 (都是没有刻度的,且 ...原创 2019-07-25 10:55:04 · 148 阅读 · 0 评论 -
J - Oil Deposits (bfs找油块)
J - Oil DepositsThe 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-07-25 11:12:58 · 135 阅读 · 0 评论 -
九连环
九连环Time Limit:1000 msMemory Limit:65536 KiBSubmitStatisticProblem Description不知道大家有没有玩过一个叫做 九连环 的玩具,如下图所示。如果你不了解九连环,那玄黄就带你领略九连环的奥妙:九连环是我国传统的民间智力玩具,玩具上面有九个连环套在杆上,目标就是通过一定的方式将九个连环从杆上全...原创 2019-07-30 15:58:57 · 474 阅读 · 0 评论 -
CodeForces - 580C (DFS)
Kefa decided to celebrate his first big salary by going to the restaurant.He lives by an unusual park. The park is a rooted tree consisting ofnvertices with the root at vertex1. Vertex1also con...原创 2019-08-17 16:05:55 · 81 阅读 · 0 评论